Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Changing Table owner

Author  Topic 

e_senthil
Starting Member

4 Posts

Posted - 2004-01-21 : 09:34:48
Hi,

I have created one table in sa login and now I want to change it's owner "dbo" to my login name.

please tell how to do that.

Thanks in advance,
senthil

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2004-01-21 : 09:35:48
Lookup sp_ChangeObjectOwner in BOL


Raymond
Go to Top of Page

e_senthil
Starting Member

4 Posts

Posted - 2004-01-21 : 09:45:42
I issued the command,

exec sp_changeobjectowner 'testtable', 'AZTEC_SOFT\senthile'

but it gives message like "User or role 'AZTEC_SOFT\senthile' does not exist in this database."

how do we know the owner names?
Go to Top of Page

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2004-01-21 : 09:50:32
Using Enterprise Manager, look under the 'Users' area under the database you are interested in. If the user you want isn't there, you'll have to add them first.


Raymond
Go to Top of Page

e_senthil
Starting Member

4 Posts

Posted - 2004-01-21 : 10:01:32
can you tell the sql command to know the existing owners in a database?

senthil
Go to Top of Page

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2004-01-21 : 10:06:36
Try

SELECT * FROM sysusers

and ignore the system users and roles.


Raymond
Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2004-01-21 : 10:07:36
select * from sysusers


SNIPED!!
-------------------------
What lies behind you and what lies ahead of you are small matters compared to what lies within you.-Ralph Waldo Emerson
Go to Top of Page
   

- Advertisement -