June 6, 2005 at 5:33 pm
Please help, I have 200 tables with a XXX owner and I need to change it to DBO. I found this command
sp_changeobjectowner but is one table at the time, I know there is a way to change them.
Please HELP,
Your help is greatly appreciated!!!
June 6, 2005 at 5:45 pm
You could hack the sytem tables but I'd advise against it. The following will generate the stored proc calls to change everything not owner by DBO to DBO, no strenuous typing required.
select 'sp_changeobjectowner "' + u.name + '.' + o.name + '","dbo"' from sysobjects o, sysusers u
where type = 'u'
and u.uid = o.uid and u.uid <> 1
June 7, 2005 at 10:55 am
Cool deal!
That worked perfect.
Thanks a lot... You rock!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply