use 你的库名
go
declare tb cursor local
for
select 'sp_changeobjectowner '
+quotename(
+quotename(user_name(uid))
+'.'+quotename(name),'''')
+',''dbo'''
from sysobjects
where objectproperty(id,N'isusertable')=1
and uid<>user_id('dbo')
declare @s nvarchar(4000)
open tb
fetch tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch tb into @s
end
close tb
deallocate tb