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! --
[quoted text, click to view] 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
[quoted text, click to view] > 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 [quoted text, click to view] "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
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] "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 >
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] "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 >
[quoted text, click to view] > 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 [quoted text, click to view] "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 >> >>
Don't see what you're looking for? Try a search.
|