您的位置:首页 > 移动开发 > Objective-C

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

2009-08-18 16:19 627 查看



Problem

After restoring DB in SQL Server 2005 db most of the time I get the following error:

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.

Solution

This was not new to me and I always used to take the following steps to solve it:

1. Right Click on your database, choose properties

2. Goto the Options Page

3. In the Dropdown at right labeled "Compatibility Level" choose "SQL Server 2005(90)"

4. Goto the Files Page

5. Enter "sa" in the owner textbox.

6. Hit OK

But for some reason today the above steps did not work.... After googling for a while I quickly found

the following suggestion which worked just fine for me....

EXEC sp_dbcmptlevel 'yourDB', '90';

go

ALTER AUTHORIZATION ON DATABASE::yourDB TO "yourLogin"

go

use [yourDB]

go

EXECUTE AS USER = N'dbo' REVERT

go
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐