"Database diagram support objects cannot be installed because this database does not have a valid owner" SQL Server 2005

Problem:
”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.”


Workaround:

EXEC sp_dbcmptlevel 'database_name', '90';
go
ALTER AUTHORIZATION ON DATABASE::database_name TO 'login'
go
use [database_name]
go
EXECUTE AS USER = N'dbo' REVERT
go

More Info:
sp_dbcmptlevel
http://msdn.microsoft.com/es-ar/library/ms178653.aspx
ALTER AUTHORIZATION
http://msdn.microsoft.com/es-ar/library/ms187359.aspx

Comentarios