如何将数据库架构更改为 dbo

我从旧的 sql server (2000) 导入了一堆表到我的 2008 数据库.所有导入的表都以我的用户名作为前缀,例如:jonathan.MovieData.在表 properties 中,它列出了 jonathan 作为数据库架构.当我编写存储过程时,我现在必须将 jonathan. 包含在所有令人困惑的表名之前.

I imported a bunch of tables from an old sql server (2000) to my 2008 database. All the imported tables are prefixed with my username, for example: jonathan.MovieData. In the table properties it lists jonathan as the db schema. When I write stored procedures I now have to include jonathan. in front of all the table names which is confusing.

如何将我的所有表更改为 dbo 而不是 jonathan?

How do I change all my tables to be dbo instead of jonathan?

当前结果:jonathan.MovieData

预期结果:dbo.MovieData

推荐答案

ALTER SCHEMA dbo TRANSFER jonathan.MovieData;

请参阅ALTER SCHEMA.

通用语法:

ALTER SCHEMA TargetSchema TRANSFER SourceSchema.TableName; 

相关文章