Thứ Ba, 25 tháng 11, 2008

Cannot Create Database Diagram with SQL Server 2005

TITLE: Microsoft SQL Server Management Studio

——————————

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.

——————————

BUTTONS:

OK

He asked me to find the solution and I found it. So I am putting it here. So you don’t have to struggle for it.

SOLUTION:

  1. Just copy below SP and copy it to Management studio

EXEC sp_dbcmptlevel , ‘90′;

go

ALTER AUTHORIZATION ON DATABASE::db_name TO [login_name]

go

use []

go

EXECUTE AS USER = N‘dbo’ REVERT

Go

  1. Now just change to your Database name for which you are facing problem and with your username of SQL.
  2. Now Try it!!! And Enjoy
---------------------------------------------------------------------------

The other method is:

In SQL Server Management Studio do the following:

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. Click OK button

Happy Database Diagramming


Không có nhận xét nào: