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)
 Login 'sa' and user 'dbo'

Author  Topic 

dejjan
Yak Posting Veteran

99 Posts

Posted - 2004-12-02 : 06:20:36
Login 'sa' or 'BUILTIN\Administrators' are related with user 'dbo'.
But I inherit 3 Databases with no users, and 'dbo' user are not mapped to login 'sa'. I have message '[SQL-DMO]The name 'dbo' was not found in Users collection ...'
I know that SID from sysusers and sysxlogins are different, but how to fix this problem. I can't use sp_change_users_login because this procedure does not allow 'sa'.
How did it happen.
I want 'sa' to be db_owner, how to do that.
Thanks

X002548
Not Just a Number

15586 Posts

Posted - 2004-12-02 : 09:49:20
System Administrator (sa) is the top dog.

What's your problem? What are you trying to do?



Brett

8-)
Go to Top of Page

dejjan
Yak Posting Veteran

99 Posts

Posted - 2004-12-03 : 02:25:54
I want 'sa' to be db_owner of existing databases, not only to have public role. When I want to check 'db_owner' role, I have a message '[SQL-DMO]The name 'dbo' was not found in Users collection ...'
I have 'dbo' in sysusers.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-03 : 02:36:28
quote:
Originally posted by dejjan

I want 'sa' to be db_owner of existing databases, not only to have public role. When I want to check 'db_owner' role, I have a message '[SQL-DMO]The name 'dbo' was not found in Users collection ...'
I have 'dbo' in sysusers.




try sp_changedbowner 'sa'

--------------------
keeping it simple...
Go to Top of Page

dejjan
Yak Posting Veteran

99 Posts

Posted - 2004-12-03 : 04:32:41
What happen when 'sa' login lose db_owner role. How could it happen.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-03 : 04:37:33
my guess, you're seeing dbo as name and loginame as blank.

even if sa loses dbo on a database, it should be able to access the objects and make modifications. a login can be dbo, depending on how the database was setup, not just sa

--------------------
keeping it simple...
Go to Top of Page

dejjan
Yak Posting Veteran

99 Posts

Posted - 2004-12-03 : 05:12:21
No, I don't have any users in Users section of my database. I have, of course, user 'dbo' in sysusers table of current database, but it is not mapped to any login (different SID).

And, when I open Logins section (in Security) and open property of login 'sa' (or any other login), in DatabaseAccess tab, noone logins have db_owner role for my database.

When I want to add that role for 'sa' (for example), I get a message:
'[SQL-DMO]The name 'dbo' was not found in Users collection. If the name is a qualified name, use [] to separate various parts of the name, and try again.'
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-03 : 05:50:00
did you try sp_changedbowner?

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -