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 

 

相关文章:

  • 2021-10-03
  • 2022-01-17
  • 2021-07-31
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2021-10-28
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案