Code
批量修改:
EXEC sp_MSforeachtable 'exec sp_changeobjectowner ''?'',''dbo'' '
单个修改:
EXEC sp_changeobjectowner '要改的表名','dbo'
如果想修改存储过程Owner:
先把--and xtype='p' 反注释,再创建sp_changeobjectowner 存储过程。
然后执行:EXEC sp_changeobjectowner 'CurrentOwner','dbo'
批量修改:
EXEC sp_MSforeachtable 'exec sp_changeobjectowner ''?'',''dbo'' '
单个修改:
EXEC sp_changeobjectowner '要改的表名','dbo'
如果想修改存储过程Owner:
先把--and xtype='p' 反注释,再创建sp_changeobjectowner 存储过程。
然后执行:EXEC sp_changeobjectowner 'CurrentOwner','dbo'