Change Object Owner In SQL Server

 

Code

 

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

 

posted @ 2009-04-10 15:23  Insus.NET  阅读(1161)  评论(2编辑  收藏  举报