SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 Error while creating assembly
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

harshal_in
Aged Yak Warrior

India
632 Posts

Posted - 04/12/2007 :  03:25:07  Show Profile  Visit harshal_in's Homepage  Send harshal_in a Yahoo! Message  Reply with Quote
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 2
The 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

India
632 Posts

Posted - 04/12/2007 :  04:44:41  Show Profile  Visit harshal_in's Homepage  Send harshal_in a Yahoo! Message  Reply with Quote
Problem solved.
Chaning the SA owner did the trick:

EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
Go to Top of Page

holzmann
Starting Member

2 Posts

Posted - 04/23/2007 :  06:32:49  Show Profile  Reply with Quote
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 1
Cannot change the owner of the master, model, tempdb or distribution database.

Why is this then?
Go to Top of Page

harshal_in
Aged Yak Warrior

India
632 Posts

Posted - 04/23/2007 :  07:01:41  Show Profile  Visit harshal_in's Homepage  Send harshal_in a Yahoo! Message  Reply with Quote
Hi holzmann,
You need to execute the statement from the database for which you are trying to change the owner.
for eg.


use mydb
go
EXEC 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 1
Cannot change the owner of the master, model, tempdb or distribution database.

Why is this then?

Go to Top of Page

holzmann
Starting Member

2 Posts

Posted - 04/24/2007 :  04:03:38  Show Profile  Reply with Quote
<snip>

it works

thanks!
Go to Top of Page

philipg
Starting Member

1 Posts

Posted - 08/11/2008 :  19:31:57  Show Profile  Reply with Quote
Had the same problem. Ran
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
and it worked. Thanks so much!
Go to Top of Page

shifis
Posting Yak Master

Mexico
157 Posts

Posted - 10/03/2008 :  16:51:34  Show Profile  Send shifis a Yahoo! Message  Reply with Quote
And it works for me too, thanks!!!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000 Version 3.4.03