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?
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.
Enter "SA" instead of "sa" in the owner textbox. This worked for me.
In SQL Server Management Studio do the following:
after doing this, You will now be able to access the Database Diagrams.
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
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:
Or if you want to change the owner to that local Administrator account, then it should be:
Because renaming the machine to
DevPC
has eliminated the local account that used to be namedWIN-ND...\Administrator
and this has also invalidated the current owner of the database.If
SELECT @@SERVERNAME;
is not accurate (it should sayDevPC
), then in order to ensure that your server rename has taken hold within SQL Server, you may also want to issue the following: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