Home All Groups Group Topic Archive Search About

Basic question on object naming

Author
14 Jul 2005 11:32 PM
vvenk
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?

Author
14 Jul 2005 11:38 PM
Robbe Morris [C# MVP]
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



Show quote
"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?
Author
14 Jul 2005 11:59 PM
vvenk
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?
>
>
>
Author
15 Jul 2005 12:55 AM
vvenk
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?
>
>
>
Author
15 Jul 2005 1:17 AM
Robbe Morris [C# MVP]
detach it and reattach it designating Venki as the owner.

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



Show quote
"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?
>>
>>
>>

AddThis Social Bookmark Button