Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database diagram support objects cannot be installed

This is pretty confusing. I'm receiving this error whenever I try to add to (or even view) the Database Diagrams node under a Database node within SQL Server Management Studio Express (SQL Server 2008):

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.

Ok, fine. The problem is, according the Management Studio, my login is the owner of the DB. I'm using Windows Authentication when I log into Management Studio, and if I go to the Files page of the Database Properties dialog box, my login is the owner.

So next I figure, ok, maybe I'm not a member of the correct server role to actually be the owner, however, my login is a member of the sysadmin server role, which, according to this MDSN page is a perquisite for owning a database.

So finally I do some googling, and I see people telling me to try executing a statement like this:

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

My problem here is that I don't really understand what this code is doing, and no amount of trying different usernames or database names with the above statement (which appears to execute successfully) seems to fix my problem.

Can anyone think of anything I might be missing?

like image 451
Rob Avatar asked Nov 05 '10 02:11

Rob


People also ask

How do I fix this backend version is not supported to design database diagrams or tables MS Visual database Tools?

This is commonly reported as an error due to using the wrong version of SSMS(Sql Server Management Studio). Use the version designed for your database version. You can use the command select @@version to check which version of sql server you are actually using.

How do I enable a database diagram?

In Object Explorer, right-click the Database Diagrams folder or any diagram in that folder. Choose New Database Diagram on the shortcut menu. The Add Table dialog box appears. Select the required tables in the Tables list and click Add.

How do I change the authorization of a database diagram?

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.


3 Answers

Simply try this.

Alter AUTHORIZATION ON DATABASE::YourDbName TO [sa];
like image 62
Girish Gupta Avatar answered Oct 07 '22 21:10

Girish Gupta


Have you tried this set of steps, it might solve your problem:

In SQL Server Management Studio do the following:

  1. Right Click on your database, choose properties
  2. Go to the Options Page
  3. In the Dropdown at right labeled "Compatibility Level" choose "SQL Server 2005(90)"
  4. Go to the Files Page
  5. Enter "sa" in the owner textbox.
  6. Hit OK

Assuming this works and you can add DB diagrams, you can then change the owner back to your Windows user name.

like image 41
Michael Goldshteyn Avatar answered Oct 07 '22 21:10

Michael Goldshteyn


This worked for me

ALTER AUTHORIZATION ON DATABASE ::DATABASE TO sa
like image 42
johxnx Avatar answered Oct 07 '22 19:10

johxnx