ERROR MESAGGE:
“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.”
EXPLANATION:
When you move a database from another Instance to SQL Server 2005 Instance(Backup-Restore or Detach-Attach), you may encounter this error when you try to create a Database Diagram in this database.
SOLUTION:
To solve this problem, you can set and use the following script according to your environment.
You must change the value of 90 according to the SQL Server version you are using.
1 2 3 4 5 6 7 8 |
EXEC sp_dbcmptlevel 'Your_Database_Name', '90'; go ALTER AUTHORIZATION ON DATABASE::Your_Database_Name TO "Your_Login_Name" go use [Your_Database_Name] go EXECUTE AS USER = N'dbo' REVERT go |