to change owner of table xx_table to be dbo
sp_changeobjectowner 'xx_table', 'dbo'
--- Dynamic sql for multiple tables
SELECT 'sp_changeobjectowner ''' + TABLE_name +''',''mantech'''
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo'
sp_changeobjectowner 'xx_table', 'dbo'
--- Dynamic sql for multiple tables
SELECT 'sp_changeobjectowner ''' + TABLE_name +''',''mantech'''
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'dbo'
No comments:
Post a Comment