在数据库中改变对象的所有者
发表于:2007-06-07来源:作者:点击数:
标签:
查出不是dbo的所有对象 select sysobjects.name,sysusers.name from sysobjects ,sysusers where sysusers.uid=sysobjects.uid and sysusers.name'dbo' 产生SQL 语句 select 'EXEC sp_changeobjectowner '''+ sysusers.name+'.'+sysobjects.name +''',''dbo''
查出不是dbo的所有对象
select sysobjects.name,sysusers.name from sysobjects ,sysusers
where sysusers.uid=sysobjects.uid and sysusers.name<>'dbo'
产生SQL 语句
select 'EXEC sp_changeobjectowner '''+ sysusers.name+'.'+sysobjects.name +''',''dbo'''
from sysobjects ,sysusers
where sysusers.uid=sysobjects.uid and sysusers.name<>'dbo'
查出不是dbo的所有对象
select sysobjects.name,sysusers.name from sysobjects ,sysusers
where sysusers.uid=sysobjects.uid and sysusers.name<>'dbo'
产生SQL 语句
select 'EXEC sp_changeobjectowner '''+ sysusers.name+'.'+sysobjects.name +''',''dbo'''
from sysobjects ,sysusers
where sysusers.uid=sysobjects.uid and sysusers.name<>'dbo'
原文转自:http://www.ltesting.net