Problem with Database Diagrams in SQL Server 2005

After restoring a backup made in SQL Server 2000 when opening a diagram the following error ocurr:

“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.”

The problem is the compatibility level of the database. The following instruction changes the level of compatibility of the database to 90 in order for diagrams to work:

EXEC sp_dbcmptlevel ‘yourDB’, ’90’