Total Pageviews

Monday, January 16, 2012

How to change the DB schema to dbo on SQLServer 2008

Every now and then you are in need to backup and restore databases from one SQL Server to another. Furthermore, sometimes the version of the source SQL Server differs from the version of the target SQL Server.
With SQL Server 2008 Microsoft separated users from schemas.
Imported tables of an imported database may only become accessible with a prefix like "jonathan.MY_TABLE_NAME".
You can change the schema name of those tables using the ALTER SCHEMA command.
It is described in more detail here.
In my case it worked.