all groups > sql server programming > march 2007 >
You're in the

sql server programming

group:

Error msg Alter Authorization


Error msg Alter Authorization Sandy
3/20/2007 7:36:03 PM
sql server programming:
Hello -

I copied a database from work and attached it on my home computer. When I
tried to access the diagram I received the following message:

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.

I tried using the Files page and couldn't see what they were referring to.
I then tried an Alter Authorization statement as follows

ALTER AUTHORIZATION ON MyDatabaseName TO Administrator;

Msg 15151, Level 16, State 1, Line 3
Cannot find the object 'MyDatabaseName', because it does not exist or you do
not have permission.

Obviously, MyDatabaseName is the real DB name . . .

What am I doing wrong?

Any help will be greatly appreciated!
--
Re: Error msg Alter Authorization EMartinez
3/20/2007 8:28:44 PM
[quoted text, click to view]


I would try adding the user and same or higher level of permissions
prior to attaching the work database and diagram (if you have not
already). If this does not work, try being logged in as 'sa' when
performing the same actions. Also, try transferring the contents of
the dtproperties table. Hope this helps.

Regards,

Enrique Martinez
Sr. SQL Server Developer
Re: Error msg Alter Authorization Dan Guzman
3/20/2007 10:30:21 PM
[quoted text, click to view]

You need to specify 'DATABASE' as the entity type. Try

ALTER AUTHORIZATION ON DATABASE::MyDatabaseName TO Administrator;

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]
Re: Error msg Alter Authorization Sandy
3/21/2007 8:00:05 PM
Hi EMartinez -

Thanks for replying!

What do you mean by:

try transferring the contents of the dtproperties table

Can you outline the steps on how I would do that?

--
Sandy


[quoted text, click to view]
Re: Error msg Alter Authorization Sandy
3/21/2007 8:01:06 PM
Thanks for your reply, Dan.

I cut and pasted your suggestion, inserting the name of my database and
received the following message:

Msg 15151, Level 16, State 1, Line 4
Cannot find the principal 'Administrator', because it does not exist or you
do not have permission.

Any other suggestions?
--
Sandy


[quoted text, click to view]
Re: Error msg Alter Authorization Dan Guzman
3/22/2007 12:00:00 AM
[quoted text, click to view]

If you want to change database ownership to the local Windows Administrator
account, try:

ALTER AUTHORIZATION ON DATABASE::MyDatabaseName TO
[MyServerName\Administrator];

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]
AddThis Social Bookmark Button