When trying to add a diagram to an SQL Server 2005 db I got the following error:

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.

I tried the suggestion mentioned in the message but that didnt work. Also found that SQL Server Management Studio does not like you trying to change various permissions - it only works certain ways (go figure).

Anyway, eventually found this post with the solution (thanks very much to cutiepie) being:

In SQL Server Management Studio do the following:

Right Click on your database, choose properties

Goto the Options Page

In the Dropdown at right labeled "Compatibility Level" choose "SQL Server 2005(90)"

#re: Cannot add diagram to SQL Server 2005 DB: Database diagram support objects cannot be installed because this database does not have a valid owner.

Your solution only works in cases where compatibility level is set to something other than the default. There are in fact a variety of cases where this error message is the result. That's why it's so insanely annoying and misleading. The most common case is still that the user creating the database does not have a specific login account but rather is part of a group with login rights.

#re: Cannot add diagram to SQL Server 2005 DB: Database diagram support objects cannot be installed because this database does not have a valid owner.

Actually, once you set the compatibility level to SQL 2005, you should install the diagram components (by click on the diagram node) and then set the compatibility back to your default. This way you won't run the risk of having some of your old scripts generate errors. I paid my price to learn this trick.

#re: Cannot add diagram to SQL Server 2005 DB: Database diagram support objects cannot be installed because this database does not have a valid owner.

I got the same message today. I've also tried all the suggested solutions with no luck. In fact the exact same database works on my local machine, but as soon as i script it out and deploy it it complains... even with the same db owner. Very confusing