Sunday, February 19, 2012

dbo login not mapped to sa

Hi,
I have a web task in SQL 7 that is failing and I think it
might have to do with the fact that dbo isn't mapped to sa
in the users of the database, can anyone confirm? I have
recently moved this database into a hardware clustered
environment, I think it may have some to do with the
restore.
Thanks
MegHi,
The stored proc sp_change_users_login exists in sql 7, but
when using it to tie together dbo and sa I get the
following error message "Server: Msg 15287, Level 16,
State 1, Procedure sp_change_users_login, Line 33
Terminating this procedure. 'sa' is a forbidden value for
the login name parameter in this procedure.". I am going
to have a look on technet and the like for this error, but
if anyone has any other suggestions, they are welcome!
Thanks
Meg
>--Original Message--
>Hi,
>I have a web task in SQL 7 that is failing and I think it
>might have to do with the fact that dbo isn't mapped to
sa
>in the users of the database, can anyone confirm? I have
>recently moved this database into a hardware clustered
>environment, I think it may have some to do with the
>restore.
>Thanks
>Meg
>.
>|||The dbo user is a special case regarding login mapping. Database
ownership determines the login mapped to the dbo user. You can use
sp_changedbowner to specify the desired owner. This should be standard
procedure after a restore or attach from another server:
USE MyDatabase
EXEC sp_changedbowner 'sa'
GO
In some cases, you may get the ambiguous error 'the proposed owner is
already a user in the database'. In this case, you can workaround the
problem by temporarily changing ownership to a non-conflicting login:
USE MyDatabase
EXEC sp_addlogin 'TempOwner'
EXEC sp_changedbowner 'TempOwner'
EXEC sp_changedbowner 'sa'
EXEC sp_droplogin 'TempOwner'
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"meg" <meg.neeson@.barclays.co.uk> wrote in message
news:09f201c35db3$87af5610$a401280a@.phx.gbl...
> Hi,
> The stored proc sp_change_users_login exists in sql 7, but
> when using it to tie together dbo and sa I get the
> following error message "Server: Msg 15287, Level 16,
> State 1, Procedure sp_change_users_login, Line 33
> Terminating this procedure. 'sa' is a forbidden value for
> the login name parameter in this procedure.". I am going
> to have a look on technet and the like for this error, but
> if anyone has any other suggestions, they are welcome!
> Thanks
> Meg
> >--Original Message--
> >Hi,
> >
> >I have a web task in SQL 7 that is failing and I think it
> >might have to do with the fact that dbo isn't mapped to
> sa
> >in the users of the database, can anyone confirm? I have
> >recently moved this database into a hardware clustered
> >environment, I think it may have some to do with the
> >restore.
> >
> >Thanks
> >Meg
> >.
> >

No comments:

Post a Comment