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.
How do I change all my tables to be dbo instead of jonathan?
Current result: jonathan.MovieData
Desired result: dbo.MovieData
Way to do it for an individual thing:
alter schema dbo transfer jonathan.MovieData
Open SQL server as SA account and click on new query past the blow queries
than click on execute, it will rollback all owned schema back to SA account
Ref: ALTER SCHEMA
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/0a760138-460e-410a-a3c1-d60af03bf2ed.htm
ALTER SCHEMA schema_name TRANSFER securable_name