|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Basic question on object namingHello:
If I have a table named venki.TableA and if I log in as Venki, is the following syntax valid: SELECT * FROM TableA I tried it and it complained about an invalid object, TableA. However, the following works no matter who has been logged in" SELECT * FROM Venki.TableA I thought if I log in as the table owner, I don't have to add the tableowner's name to the object name? Check the permissions on the table.
-- Show quote2004 and 2005 Microsoft MVP C# Robbe Morris http://www.masterado.net Earn $$$ money answering .NET Framework messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp "vvenk" <vv***@discussions.microsoft.com> wrote in message news:8BD3B330-6D92-40B1-8707-7EEACD1551DA@microsoft.com... > Hello: > > If I have a table named venki.TableA and if I log in as Venki, is the > following syntax valid: > > SELECT * FROM TableA > > I tried it and it complained about an invalid object, TableA. > > However, the following works no matter who has been logged in" > > SELECT * FROM Venki.TableA > > I thought if I log in as the table owner, I don't have to add the > tableowner's name to the object name? Robbie:
The user, venki, has SELECT, INSERT, UPDATE and DELETE privileges on this table. Show quote "Robbe Morris [C# MVP]" wrote: > Check the permissions on the table. > > -- > 2004 and 2005 Microsoft MVP C# > Robbe Morris > http://www.masterado.net > > Earn $$$ money answering .NET Framework > messageboard posts at EggHeadCafe.com. > http://www.eggheadcafe.com/forums/merit.asp > > > > "vvenk" <vv***@discussions.microsoft.com> wrote in message > news:8BD3B330-6D92-40B1-8707-7EEACD1551DA@microsoft.com... > > Hello: > > > > If I have a table named venki.TableA and if I log in as Venki, is the > > following syntax valid: > > > > SELECT * FROM TableA > > > > I tried it and it complained about an invalid object, TableA. > > > > However, the following works no matter who has been logged in" > > > > SELECT * FROM Venki.TableA > > > > I thought if I log in as the table owner, I don't have to add the > > tableowner's name to the object name? > > > Robbie:
I had attached this table after re-installing SQL Server. In the process, the login name was screwed up. When I reassigned the ownership to sa, deleted the login "venki", reassigned "venki" to the dbowner and table owner, Syntax 1 works. Thanks. Venki Show quote "Robbe Morris [C# MVP]" wrote: > Check the permissions on the table. > > -- > 2004 and 2005 Microsoft MVP C# > Robbe Morris > http://www.masterado.net > > Earn $$$ money answering .NET Framework > messageboard posts at EggHeadCafe.com. > http://www.eggheadcafe.com/forums/merit.asp > > > > "vvenk" <vv***@discussions.microsoft.com> wrote in message > news:8BD3B330-6D92-40B1-8707-7EEACD1551DA@microsoft.com... > > Hello: > > > > If I have a table named venki.TableA and if I log in as Venki, is the > > following syntax valid: > > > > SELECT * FROM TableA > > > > I tried it and it complained about an invalid object, TableA. > > > > However, the following works no matter who has been logged in" > > > > SELECT * FROM Venki.TableA > > > > I thought if I log in as the table owner, I don't have to add the > > tableowner's name to the object name? > > > detach it and reattach it designating Venki as the owner.
-- Show quote2004 and 2005 Microsoft MVP C# Robbe Morris http://www.masterado.net Earn $$$ money answering .NET Framework messageboard posts at EggHeadCafe.com. http://www.eggheadcafe.com/forums/merit.asp "vvenk" <vv***@discussions.microsoft.com> wrote in message news:257E84CF-D526-4F73-8744-CAA819E8C3E1@microsoft.com... > Robbie: > > I had attached this table after re-installing SQL Server. In the process, > the login name was screwed up. > > When I reassigned the ownership to sa, deleted the login "venki", > reassigned > "venki" to the dbowner and table owner, Syntax 1 works. > > Thanks. > > Venki > > "Robbe Morris [C# MVP]" wrote: > >> Check the permissions on the table. >> >> -- >> 2004 and 2005 Microsoft MVP C# >> Robbe Morris >> http://www.masterado.net >> >> Earn $$$ money answering .NET Framework >> messageboard posts at EggHeadCafe.com. >> http://www.eggheadcafe.com/forums/merit.asp >> >> >> >> "vvenk" <vv***@discussions.microsoft.com> wrote in message >> news:8BD3B330-6D92-40B1-8707-7EEACD1551DA@microsoft.com... >> > Hello: >> > >> > If I have a table named venki.TableA and if I log in as Venki, is the >> > following syntax valid: >> > >> > SELECT * FROM TableA >> > >> > I tried it and it complained about an invalid object, TableA. >> > >> > However, the following works no matter who has been logged in" >> > >> > SELECT * FROM Venki.TableA >> > >> > I thought if I log in as the table owner, I don't have to add the >> > tableowner's name to the object name? >> >> >> |
|||||||||||||||||||||||