Thinking outside the box

Patron Saint of Lost Yaks
posts - 200, comments - 701, trackbacks - 4

My Links

Advertisement

News

Archives

Post Categories

Change schema for all tables

I just helped a guy here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98346 with schema
and thought that someone could benefit from this code

exec

 

 

sp_MSforeachtable "PRINT '? modify'; ALTER SCHEMA new_schema TRANSFER ?; IF @@ERROR = 0 PRINT '? modified'; PRINT ''"

Print | posted on Wednesday, March 05, 2008 1:31 AM | Filed Under [ SQL Server 2008 Administration SQL Server 2005 ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   

Powered by:
Powered By Subtext Powered By ASP.NET