--EXEC sp_changeobjectowner 'ltd.News', 'dbo'
DECLARE @name varchar(200)
DECLARE @owner varchar(50)
DECLARE @xtype varchar(50)
DECLARE @buff varchar(200)
DECLARE curObject CURSOR FOR
select name,
user_name(uid),xtype
from sysobjects
where user_name(uid)='zqoa' and xtype = 'P' and name not like 'dt_%'
--order by name
OPEN curObject
FETCH NEXT FROM curObject INTO @name, @owner,@xtype
WHILE(@@FETCH_STATUS=0)
BEGIN
set @buff = ''
set @buff = 'zqoa.'+@name
--print @name
exec sp_changeobjectowner @buff ,'dbo'
FETCH NEXT FROM curObject INTO @name, @owner,@xtype
END
close curObject
deallocate curObjec
go
--exec sp_changeobjectowner "zqoa.zq_fc_Moudle" ,'dbo'