views:

227

answers:

2

When I accidentally click on the Database Diagrams tab, I get one of the following errors:

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.

--- or ---

The database does not have one or more of the support objects required to use database diagramming. Do you wish to create them?

What's the syntax for changing the owner of this database to 'sa'?

+1  A: 

This is a prompt to create a bunch of object, such as sp_help_diagram (?), that do not exist.

This should have nothing to do with the owner of the db.

gbn
Can you explain why that I am no longer prompted for this after I change the owner? Are the objects automatically created or does SQL Server just stop asking me because my account is no longer the owner?
Even Mien
In this case, the DB was owned by login that had been dropped. I'm not sure why because "sa" owns all our databases.
gbn
+2  A: 

to change the object owner try the following

EXEC sp_changedbowner 'sa'

that however is not your problem, to see diagrams the Da Vinci Tools objects have to be created (you will see tables and procs that start with dt_) after that

SQLMenace