[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

Error msg Alter Authorization

Sandy

3/21/2007 2:36:00 AM

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!
--
Sandy
5 Answers

EMartinez

3/21/2007 3:29:00 AM

0

On Mar 20, 9:36 pm, Sandy <S...@discussions.microsoft.com> wrote:
> 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!
> --
> Sandy


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

Dan Guzman

3/21/2007 3:30:00 AM

0

> What am I doing wrong?

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

"Sandy" <Sandy@discussions.microsoft.com> wrote in message
news:698CCA0F-9BC4-413A-8A02-E29A6598918E@microsoft.com...
> 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!
> --
> Sandy

Sandy

3/22/2007 3:00:00 AM

0

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


"EMartinez" wrote:

> On Mar 20, 9:36 pm, Sandy <S...@discussions.microsoft.com> wrote:
> > 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!
> > --
> > Sandy
>
>
> 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
>
>

Sandy

3/22/2007 3:01:00 AM

0

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


"Dan Guzman" wrote:

> > What am I doing wrong?
>
> 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
>
> "Sandy" <Sandy@discussions.microsoft.com> wrote in message
> news:698CCA0F-9BC4-413A-8A02-E29A6598918E@microsoft.com...
> > 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!
> > --
> > Sandy
>
>

Dan Guzman

3/22/2007 1:15:00 PM

0

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

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

"Sandy" <Sandy@discussions.microsoft.com> wrote in message
news:011AA8B4-41B0-4524-BDA1-F7CD99363F9E@microsoft.com...
> 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
>
>
> "Dan Guzman" wrote:
>
>> > What am I doing wrong?
>>
>> 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
>>
>> "Sandy" <Sandy@discussions.microsoft.com> wrote in message
>> news:698CCA0F-9BC4-413A-8A02-E29A6598918E@microsoft.com...
>> > 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!
>> > --
>> > Sandy
>>
>>