Sql Server 2005: Change schema for all tables
I recently needed to change the schema for all the tables in a Sql Server 2005 database.
Sql Server 2005 provides a T-SQl statement capable to change the schema for a given object called ALTER SCHEMA
You may use the following syntax to change the schema for all the tables in a database. Just change the "new_schema" string with the desired one:
exec sp_MSforeachtable "ALTER SCHEMA new_schema TRANSFER ? PRINT '? modified' "
Enjoy!
This blog is dedicated to all the scholar of web hosting. You will get all solution of your web hosting issue. If you have any query regarding web hosting then you can mail me whatishosting.com[at]gmail.com
Translate
Subscribe to:
Post Comments (Atom)
About Me
- Himanshu
- Greetings Friend! I am Linux scholar, trying to learn as much I can and share it with you. I am in mid of my Professional Career. Doing Good. :)
No comments:
Post a Comment