Following code demotrate to change all tables' owner to "dbo":
declare tb cursor local
for select 'sp_changeobjectowner ''taishanpcb.'+name+''',''dbo'''
from sysobjects
where status>=0
and xtype in('FN','IF','P','TF','U','V','X')
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
declare tb cursor local
for select 'sp_changeobjectowner ''taishanpcb.'+name+''',''dbo'''
from sysobjects
where status>=0
and xtype in('FN','IF','P','TF','U','V','X')
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