Database Diagram Support Objects cannot be Installed ... no valid owner

Sql ServerSql Server-2008Database Diagramming

Sql Server Problem Overview


I tried to create a database diagramm with SQL Server 2008, but an error occurs:

> 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.

Then I tried the following:

EXEC sp_dbcmptlevel 'Ariha', '90';
GO
ALTER AUTHORIZATION ON DATABASE::Ariha TO [WIN-NDKPHUPPNFL\Administrator]
GO
USE Ariha
GO
EXECUTE AS USER = N'dbo' REVERT
GO

Next erorr pops up:

> Msg 15404, Level 16, State 11, Line 1 > Could not obtain information about > Windows NT group/user > 'WIN-NDKPHUPPNFL\Administrator', error > code 0x534.

The Problem is the name of the PC has changed into "DevPC" I also changed this in the update script, but still the same error 15404.

What can I do to fix this annoying error?

Sql Server Solutions


Solution 1 - Sql Server

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 Drop down at right labeled "Compatibility Level" choose "SQL Server 2005(90)" 3-1. choose "SQL Server 2008" if you receive a comparability error.
  4. Go to the Files Page
  5. Enter "sa" in the owner textbox. 5-1 or click on the ellipses(...) and choose a rightful owner.
  6. Hit OK

after doing this, You will now be able to access the Database Diagrams.

enter image description here

Solution 2 - Sql Server

You should consider SQL authentication account for database ownership; then you don't have to worry about accounts coming and going, databases or instances moving to different servers, and your next PC name change. I have several systems where we use:

ALTER AUTHORIZATION ON DATABASE::Ariha TO [sa];

Or if you want to change the owner to that local Administrator account, then it should be:

ALTER AUTHORIZATION ON DATABASE::Ariha TO [DevPC\Administrator];

Because renaming the machine to DevPC has eliminated the local account that used to be named WIN-ND...\Administrator and this has also invalidated the current owner of the database.

If SELECT @@SERVERNAME; is not accurate (it should say DevPC), then in order to ensure that your server rename has taken hold within SQL Server, you may also want to issue the following:

EXEC sys.sp_dropserver @server = N'old server name';
GO
EXEC sys.sp_addserver @server = N'DevPC', @local = N'local';
GO

Solution 3 - Sql Server

USE [ECMIS]
GO
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO

It works.

Solution 4 - Sql Server

Enter "SA" instead of "sa" in the owner textbox. This worked for me.

Solution 5 - Sql Server

I had the same problem.
I wanted to view my diagram, which I created the same day at work, at home. But I couldn't because of this message.
I found out that the owner of the database was the user of my computer -as expected. but since the computer is in the company's domain, and I am not connected to the company's network, the database couldn't resolve the owner.

So what I did is change the owner to a local user and it worked!!
Hope this helps someone.

You change the user by right-click on the database, properties, files, owner

Solution 6 - Sql Server

Select your database - Right Click - Select Properties

Select FILE in left side of page

In the OWNER box, select button which has three dots (…) in it

Now select user ‘sa and Click OK

Solution 7 - Sql Server

This fixed it for me. It sets the owner found under the 'files' section of the database properties window, and is as scripted by management studio.

USE [your_db_name]
GO
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO

According to the sp_changedbowner documentation this is deprecated now.

Based on Israel's answer. Aaron's answer is the non-deprecated variation of this.

Solution 8 - Sql Server

I just experienced this. I had read the suggestions on this page, as well as the SQL Authority suggestions (which is the same thing) and none of the above worked.

In the end, I removed the account and recreated (with the same username/password). Just like that, all the issues went away.

Sadly, this means I don't know what went wrong so I can't share any thing else.

Solution 9 - Sql Server

1.Right click on your Database , 2.Then select properties . 3.Select the option in compatibility levels choose sql 2008[100] if you are working with Microsoft sql 2008.

4.Then select the file and write ( sa ) in owner`s textbox

100% works for me.

Solution 10 - Sql Server

An easier way to solve this issues would be to right click the name of your database, choose "New Query", type " exec sp_changedbowner 'sa' " and execute the query. Then you'll be good to go.

Solution 11 - Sql Server

you must enter as administrator right click to microsofft sql server management studio and run as admin

Solution 12 - Sql Server

Only need to execute it in query editor ALTER AUTHORIZATION ON DATABASE::YourDatabase TO [domain\account];

Solution 13 - Sql Server

The real problem is that the default owner(dbo) doesn't have a login mapped to it at all.As I tried to map the sa login to the database owner I received another error stating "User,group, or role 'dbo' already exists...".However if you try this code it will actually works :

>>EXEC sp_dbcmptlevel 'yourDB', '90';

>>go

>>ALTER AUTHORIZATION ON DATABASE::yourDB TO "yourLogin"

>>go

>>use [yourDB]

>>go

>>EXECUTE AS USER = N'dbo' REVERT

>>go

Solution 14 - Sql Server

right click on your Database , then select properties . select the option in compatibility levels choose sql 2005[90] instead of 2008 if you are working with Microsoft sql 2008. then select the file and write ( sa ) in owner`s textbox. it will work probably

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRookianView Question on Stackoverflow
Solution 1 - Sql ServerIsrael MarguliesView Answer on Stackoverflow
Solution 2 - Sql ServerAaron BertrandView Answer on Stackoverflow
Solution 3 - Sql ServerRafiOView Answer on Stackoverflow
Solution 4 - Sql ServerAdarsh V CView Answer on Stackoverflow
Solution 5 - Sql ServerPhpLouView Answer on Stackoverflow
Solution 6 - Sql ServerAnil RanaView Answer on Stackoverflow
Solution 7 - Sql ServerTim AbellView Answer on Stackoverflow
Solution 8 - Sql ServerDaveView Answer on Stackoverflow
Solution 9 - Sql ServerJefferson X MasonicView Answer on Stackoverflow
Solution 10 - Sql ServerLebone McdonaldView Answer on Stackoverflow
Solution 11 - Sql Serverabdelnaser rafatView Answer on Stackoverflow
Solution 12 - Sql ServerNui SanView Answer on Stackoverflow
Solution 13 - Sql ServerVandanaView Answer on Stackoverflow
Solution 14 - Sql ServerEzzo gasmallahView Answer on Stackoverflow