The Database Diagrams solution for SQL Server 2008

Today, i want to create a database diagram for my a database. it throws an error "Database diagram support objects cannot be installed because this database does not have a valid owner..." when i was clicking on New database diagram menu. My SQL Server is 2008 express.

Luckily, i excuted the following script, and then the problem are fixed. 

 

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

 

 

 

你可能感兴趣的:(SQL Server 2008)