Monday, August 29, 2011

Resolved Creating Database Diagram In Sql Server 2008 Express

While creating database diagram in Sql Server 2008, we may get 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.

We need to following steps to resolve this issue.

In SQL Server Management Studio do the following:

1. Right Click on your database, go to properties
2. Goto the Options Page
3. In the Dropdown at right labeled "Compatibility Level" choose "SQL Server 2005(90)"
4. Goto the Files Page
5. Enter "sa" in the owner textbox.
6. press OK

Steps 2 and 3 are optional. With out these steps also I was able to create DB diagram in Sql Server 2008.