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 Administration (2000)
 Owner of table

Author  Topic 

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-06-25 : 07:59:45
i have a database that has
dbo username rather than sa

Im trying to change the user name to another name

use TESTA exec sp_CHANGEDBOWNER 'SA', 'AAC_MAIN\SLAuthority'

But it still remains as sa

nr
SQLTeam MVY

12543 Posts

Posted - 2007-06-25 : 08:07:42
suspect you want sp_changedbowner.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-06-25 : 08:13:25
I did just
SP_CHANGEDBOWNER 'aac_main\newname'

That worked.

Why is it that you change the dbo to another name rather than the sa and just add the user as owner ?

Always confuses me why some applications do this.

Thanks
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-06-25 : 08:19:23
Not sure what you mean
You change a database owner to another login whereas you change an object owner to a user in the database.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-06-25 : 08:27:04
When you first create a database this is dbo sa

TESTA
dbo sa

Some applications use say

dbo MP2

dbo EPLANNER

So sa is not the owner.

So i was wondering why some applications do this rather than adding the user MP2 to the database and making it db owner

i.e
dbo sa
mp2 mp2

Thanks
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-06-25 : 08:31:17
Still confused.

sa is the owner of the database but the owner of the objects is dbo (i.e. the database owner which happens at this point to be sa).
If you try to acces an object without qualifying the owner it will look for that object owned by you, if that doesn't exist it will loko for the object owned by dbo.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-06-25 : 08:37:29
Thanks
Go to Top of Page
   

- Advertisement -