Cannot create database diagrams in SQL Server 2005 due to authorization problem

0 votes

I have SQL Server 2005 Enterprise Edition, restored one database which backed up from another SQL Server database. When i try to goto database diagrams, always it is showing the below error message:

 

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.

asked Jan 28, 2013 by inquirer (710 points)
    

1 Answer

0 votes
 
Best answer

 

Modify the below script based your DB.
EXEC sp_dbcmptlevel 'DBNAME', '90'
ALTER AUTHORIZATION ON DATABASE::DBNAME TO "USERNAME"
USE [DBNAME]
EXECUTE AS USER = N'dbo' REVERT

 

answered Jan 28, 2013 by analyst (3,200 points)
selected Jan 28, 2013 by inquirer
...