tags:

views:

54

answers:

1

I have two databases, production and stage. I am getting the error message in the title of this post when I click "Database Diagrams" for production, but on stage I don't get an error.

I've researched this message, and I've found posts such as this: http://geekswithblogs.net/shahed/archive/2007/11/19/116940.aspx

They pretty much say to change the owner of my database to sa. I'm not convinced this is the issue, though, because both production and stage databases have the same owner (not sa), but I only get this error for production.

Does anyone else know how else to resolve this error message?

+2  A: 

both production and stage databases have the same owner (not sa), but I only get this error for production.

That usually is the very source of the problem: a database created on one machine is restored on a different machine where the SID of the original creator is no longer valid. Change the owner to a valid one:

ALTER AUTHORIZATION ON DATABASE::[<dbname>] TO sa;
Remus Rusanu
I ran "EXEC sp_helpdb" and saw that the owner was what I expected, for example "myuser".I ran this query: "EXEC sp_changedbowner 'myuser'", where "myuser" is the exact user I copied from the results of the sp_helpdb command, and now it's working right. Maybe this has to do with it getting the right SID that you mentioned?
Pamela
Hmm... If sp_helpdb was capable of identifying 'myuser' correctly, then the dbo SID must had been a valid one, otherwise is not possible for SQL to figure out on its own that '1-5-002348778..' (ie. a SID) realy stands for 'myuser'.
Remus Rusanu