October 13, 2005 at 7:57 pm
Hello,
I need to delete a security login from a single instance of SQL Server 2000. When I try to delete the login I receive a message that says something like "cannot delete this login because it owns objects." I know this user created, and is the owner of, a couple of tables and one DTS Package. I have two questions:
1. Is there a way to find out all of the objects per an owner?
2. How do I change the owner of an object and to what? Do I use SS2000 SP's and use dbo as the owner?
Thanks,
Steve
October 13, 2005 at 8:38 pm
one way is,
loop thru all your databases in the instance
run this:
select 'sp_changeobjectowner "' + su.name + '.' + so.name + '",' + 'dbo'
from sysobjects so, sysusers su
where so.uid = su.uid
and su.name = 'username' --username you want to remove
October 21, 2005 at 12:56 pm
Thanks ND. Your solution worked just fine.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply