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.
Author |
Topic |
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2007-04-12 : 03:25:07
|
I am trying to create an assembly on a sql server 2005 machine but it gives me following error:Msg 33009, Level 16, State 2, Line 2The database owner SID recorded in the master database differs from the database owner SID recorded in database 'XYZ'. You should correct this situation by resetting the owner of database 'XYZ' using the ALTER AUTHORIZATION statement.I tried using the alter authorization statement to change the owner.It did not work.The same assembly is created on another test database but can not create it on this database.Is this because of orphan logins? Thanks for the help.Harshal. |
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2007-04-12 : 04:44:41
|
Problem solved.Chaning the SA owner did the trick:EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false |
|
|
holzmann
Starting Member
2 Posts |
Posted - 2007-04-23 : 06:32:49
|
Hi Harshal,I am experiencing the same problem. I tried the statement you provided and it helped - just once.I am still getting the error "The database owner SID recorded ..." after restoring my DB. When I apply your line, I am getting:Msg 15109, Level 16, State 1, Line 1Cannot change the owner of the master, model, tempdb or distribution database.Why is this then? |
|
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2007-04-23 : 07:01:41
|
Hi holzmann,You need to execute the statement from the database for which you are trying to change the owner.for eg.use mydbgoEXEC dbo.sp_changedbowner @loginame = N'sa', @map = false replace mydb with your database name.hope this helps.Harshal.quote: Originally posted by holzmann Hi Harshal,I am experiencing the same problem. I tried the statement you provided and it helped - just once.I am still getting the error "The database owner SID recorded ..." after restoring my DB. When I apply your line, I am getting:Msg 15109, Level 16, State 1, Line 1Cannot change the owner of the master, model, tempdb or distribution database.Why is this then?
|
|
|
holzmann
Starting Member
2 Posts |
Posted - 2007-04-24 : 04:03:38
|
<snip>it worksthanks! |
|
|
philipg
Starting Member
1 Post |
Posted - 2008-08-11 : 19:31:57
|
Had the same problem. RanEXEC dbo.sp_changedbowner @loginame = N'sa', @map = falseand it worked. Thanks so much! |
|
|
shifis
Posting Yak Master
157 Posts |
Posted - 2008-10-03 : 16:51:34
|
And it works for me too, thanks!!! |
|
|
|
|
|
|
|