Tuesday, 27 March 2012

Sql server: change the object owner

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'

No comments:

Post a Comment

Number of Visitors