Tuesday, March 27, 2012

Cant get diagrams to work in SQL Management Studio

I can't get diagrams to work in SQL Management Studio. When I try to open that folder in the object browser, I get:
"Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects."
That's great, but what exactly constitutes a "valid login" and who or what is it supposed to be?
If you follow the first set of steps, click the button with theellipsis next to the owner textbox, and you'll get a list of validlogins that you can choose an owner from. Then save it, andyou should be ready to go.
|||But other than myself (the one it's already set to), there are no otheraccounts other than system accounts. How is me being an owner not goodenough?
|||Huh. Well, if you go to the Security node for your SQL Serverinstance, and look at the Logins, is your account in there? If itis, and you're still getting the error, you might try changing the DBowner to another account, save it, and then change it back toyourself.
|||Tried all of the above. No joy. I am the owner, or so it says.
This is seriously annoying, and in true MS documentation fashion, the docs are not helpful.
|||Was this database by any chance restored from another machine? Maybe a machine on another domain? Or have there been changes tothe domain since the database was created? That's the last thingthat I can think of...That even though the account *looks* to be thesame on the surface, that underneath, it's got a different SID than theaccount that's been granted access to the SQL Server instance. Ifthat's the case, then the remedy would be to delete your accountentirely from list of the database's users, and then re-add it. If that's not the solution, hopefully someone else will have a tip,'cause I'm out of ideas.
|||The database was upgraded from the old 2000 Dev Edition to the 2005 DevEdition. I ended up scripting the database, nuking it, and recreatingit since there was nothing critical about the actual data. All is wellnow. It was still annoying. :)
|||

Solution, you need to go:

Properties of your database
Options
Compatibility level and here select SQL Server 2005
Click OK
Go to Database Diagrams and it will ask you if you want to create it , put yes and you will get your diagrams.
Hope it helps.
Sorry for my english im from Argentine.

|||I think it had to do with the compatibility level. I had the same with a restored 2000 database on 2005. Couldn't access the diagrams. But after setting the compatibility level (properties of database then the options page) to SQL Server 2005 (90), I was able to access them. (some didn't work though)
gr Rc

No comments:

Post a Comment