To change the schema for all tables this would look like:
exec sp_MSforeachtable "ALTER SCHEMA new_schema TRANSFER ? PRINT '? modified' "
Which would look like this if you want to alter schema to dbo:
exec sp_MSforeachtable "ALTER SCHEMA dbo TRANSFER ? PRINT '? modified' "
No comments:
Post a Comment