Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Changing schema for all tables in a database

Author  Topic 

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2012-08-24 : 12:16:13
Hi,

I have one request to change schema for all tables in a database. Say schema1.table1 change to schema2.table1. I need to change for all tables in the database. Schema is already there.

Thanks

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-08-24 : 12:31:08
alter schema TargetSchema TRANSFER OriginalSchema.TableName;

=================================================
We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry
Go to Top of Page
   

- Advertisement -