Zack
asked on
Changing the Schema for all Tables in a Tables - MS SQL Server 2008 R2.
Hi EE,
I know to change the schema name of table you the following command:
ALTER SCHEMA MySchema TRANSFER dbo.MyTable
My query are there any scripts out there that do this to all the tables in a database as this database has hundreds of tables?
Any assistance is appreciated.
Thank you.
I know to change the schema name of table you the following command:
ALTER SCHEMA MySchema TRANSFER dbo.MyTable
My query are there any scripts out there that do this to all the tables in a database as this database has hundreds of tables?
Any assistance is appreciated.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for the link.
'ALTER SCHEMA myschema TRANSFER ' + dbo.Mytable
then execute it.
Sorry, not at a computer to code it exactly.
Kelvin