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)
 sp_changedbowner 'domain\groupname'

Author  Topic 

oitsubob
Yak Posting Veteran

70 Posts

Posted - 2006-02-02 : 13:58:43
Hi!
I'm trying to change the db owner on one of our databases to a domain global group. I've granted this group login rights to the server. I haven't placed the group into any fixed roles or given it access to any database.

I tried running the sp_changedbowner proc as follows:

exec sp_changedbowner 'domain\groupname'

and I receive the following error:

Server: Msg 15007, Level 16, State 1, Procedure sp_changedbowner, Line 33
The login 'domain\groupname' does not exist.

However, when I run sp_helplogins, it appears to be valid.

What am I missing?

Thanks,

Bob

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-02-02 : 14:02:13
quote:

Is the name of the security account that will be the new owner of the object. owner is sysname, with no default. owner must be a valid Microsoft® SQL Server™ user or role, or Microsoft Windows NT® user or group in the current database. When specifying Windows NT users or groups, specify the name the Windows NT user or group is known by in the database



So have you checked what name the group has in the actual database?

Tara Kizer
aka tduggan
Go to Top of Page

oitsubob
Yak Posting Veteran

70 Posts

Posted - 2006-02-02 : 14:05:55
I actually hadn't granted it any access to the database -- yet.

Looking up the proc in BOL, it states "login cannot become the owner of the current database if it already has access to the database through an existing alias or user security account within the database".

Bob
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-02-02 : 14:12:52
I looked up the wrong system stored procedure. Perhaps a group can't be the owner of a database. I've only ever seen single logins be owners.

Tara Kizer
aka tduggan
Go to Top of Page

oitsubob
Yak Posting Veteran

70 Posts

Posted - 2006-02-02 : 14:17:11
So I tried granting the group access to the db and made it a member of the 'public' database role.

When I look at the database users, it shows the name as "groupname" and login as "domain\groupname". From there I executed the SP above using both the original login format and just "groupname", but I still get the same error.

I must be missing something here, but I just don't see it.

Thanks Again,

Bob

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-02-02 : 14:22:06
You can ignore my first post. I wasn't looking at the right system stored procedure when I quoted BOL.

Tara Kizer
aka tduggan
Go to Top of Page

oitsubob
Yak Posting Veteran

70 Posts

Posted - 2006-02-02 : 14:36:56
Thanks Tara...you may be right. I'll have to do a little more research on this.
Go to Top of Page
   

- Advertisement -