views:

159

answers:

1

Hi!

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  A: 

What does @@SERVERNAME show? Also have you considered using sql auth for database owners? I have several systems where we use:

ALTER AUTHORIZATION ON DATABASE::Ariha TO [sa];
Aaron Bertrand
it shows: "WIN-NDKPHUPPNFL"I used your sql statement and it works ... but is this setup correct or do I have to do anything else more?
Rookian
Well, that really depends. If you need your database to be owned by a Windows domain/workgroup user, then there is probably more work to do. Personally, I find this problematic. Maybe read this first: http://sqlblog.com/blogs/tibor_karaszi/archive/2009/12/30/using-sa-as-owner-for-jobs-and-databases.aspx
Aaron Bertrand