韩国、日本、香港、美国CN2独立服务器与VPS主机租用! 2 0 0 5 - 2 0 2 3 十 七 年 I D C 行 业 服 务 (Q Q:278550633)

删除sql数据库所有者

declare tb cursor local for
select 'sp_changeobjectowner ''['+replace(user_name(uid),']',']]')+'].['+replace(name,']',']]')+']'',''dbo'''
from sysobjects
where xtype in('U','V','P','TR','FN','IF','TF') and status>=0
open tb
declare @s nvarchar(4000)
fetch tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch tb into @s
end
close tb
deallocate tb
go

作者:safeidc 分类:Windows技术文档 浏览:916 评论:0