Showing posts with label onethis. Show all posts
Showing posts with label onethis. Show all posts

Friday, March 9, 2012

PROBLEM: Login name is 'dbo' ?? in Database

Here is a good one:
This is from sp_helplogins:
LOGINNAMEDATABASE
DOMAIN\LOGIN1Database1db_ownerMemberOf
DOMAIN\LOGIN1Database1dboUser
DOMAIN\LOGIN1Database2db_ownerMemberOf
DOMAIN\LOGIN1Database2DOMAIN\LOGIN1User
ALTER USER [dbo] WITH NAME=[DOMAIN\LOGIN1]
GO
results in:
Msg 15150, Level 16, State 1, Line 1
Cannot alter the user 'dbo'.
Someone must have tried to make the login db_owner by setting the name
to 'dbo'. What I need is to have the 2nd line above have DOMAIN\LOGIN1
as a user in Database1. Any ideas on how to fix this mess?
Supposing that DOMAIN\LOGIN1 is represented by the dbo user, what problem do
you have?
Please, rate this post. Thanks!
May the bytes be with you!!!
Pedro López-Belmonte Eraso
MCAD, MCT
"Erik G" wrote:

> Here is a good one:
> This is from sp_helplogins:
> LOGINNAMEDATABASE
> DOMAIN\LOGIN1Database1db_ownerMemberOf
> DOMAIN\LOGIN1Database1dboUser
> DOMAIN\LOGIN1Database2db_ownerMemberOf
> DOMAIN\LOGIN1Database2DOMAIN\LOGIN1User
> ALTER USER [dbo] WITH NAME=[DOMAIN\LOGIN1]
> GO
> results in:
> Msg 15150, Level 16, State 1, Line 1
> Cannot alter the user 'dbo'.
> Someone must have tried to make the login db_owner by setting the name
> to 'dbo'. What I need is to have the 2nd line above have DOMAIN\LOGIN1
> as a user in Database1. Any ideas on how to fix this mess?
>
|||On Jan 18, 3:59Xpm, Pedro Lpez-Belmonte
<plber...@.mizarsoluciones.com.quitaestoparaenviar> wrote:
> Supposing that DOMAIN\LOGIN1 is represented by the dbo user, what problem do
> you have?
I can not add a DOMAIN\LOGIN1 as a user. I need to set a database
role (db_role1 for this example) for user DOMAIN\LOGIN1 and the user
does not exist. I don't want DOMAIN\LOGIN1 to be db_owner, I want it
to be a user with db_role1.
Thanks
Erik
|||> ALTER USER [dbo] WITH NAME=[DOMAIN\LOGIN1]
> GO
> results in:
> Msg 15150, Level 16, State 1, Line 1
> Cannot alter the user 'dbo'.
You need to change the database owner to a different login before you can
add the user to the database as a normal user. For example:
USE Database1;
ALTER AUTHORIZATION ON DATABASE::Database1 TO [sa];
CREATE USER [DOMAIN\LOGIN1];
For more info in database ownership issues, see
http://weblogs.sqlteam.com/dang/archive/2008/01/13/Database-Owner-Troubles.aspx
Hope this helps.
Dan Guzman
SQL Server MVP
"Erik G" <info@.fdaregulatory.com> wrote in message
news:ffe839b8-93fd-4281-b494-f5b439d7d351@.s12g2000prg.googlegroups.com...
> Here is a good one:
> This is from sp_helplogins:
> LOGINNAME DATABASE
> DOMAIN\LOGIN1 Database1 db_owner MemberOf
> DOMAIN\LOGIN1 Database1 dbo User
> DOMAIN\LOGIN1 Database2 db_owner MemberOf
> DOMAIN\LOGIN1 Database2 DOMAIN\LOGIN1 User
> ALTER USER [dbo] WITH NAME=[DOMAIN\LOGIN1]
> GO
> results in:
> Msg 15150, Level 16, State 1, Line 1
> Cannot alter the user 'dbo'.
> Someone must have tried to make the login db_owner by setting the name
> to 'dbo'. What I need is to have the 2nd line above have DOMAIN\LOGIN1
> as a user in Database1. Any ideas on how to fix this mess?