SELECT 'EXEC(''sp_changeobjectowner @objname = '''''+
ltrim(u.name) + '.' + ltrim(s.name) + ''''''
+ ', @newowner = dbo'')'
FROM sysobjects s,
sysusers u
WHERE s.uid = u.uid
AND u.name <> 'dbo'
AND xtype in ('V', 'P', 'U')
AND u.name not like 'INFORMATION%'
order by s.name
Wednesday, October 12, 2005
SQL Server - alle objecten owned by dbo maken
Dit statement genereerd voor elk object dat niet 'owned by dbo' is een sp_changeobjectowner statement.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment