Wednesday, March 21, 2012

invalid object name

In my database I have created a table called "com01" owned
by "lisa" and if I try to select the rows with the
statement "select * from lisa.com01" it works fine !
But if I submit the statement "select * from com01" it
return the error:
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'com01'.
Why '
In both cases I'm connected to the database with
user "lisa" who is the owner of the table. There isn't
other table called "com01" in the database.
Help me please !!!Is 'lisa' a member of the sysadmin role? In this case, the default owner
will be 'dbo' instead of 'lisa' when resolving object names. You can
determine the name used for object name resolution with SELECT USER.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"paolo" <paolo.ricci@.gidi.it> wrote in message
news:746e01c494d7$50f799a0$a501280a@.phx.gbl...
> In my database I have created a table called "com01" owned
> by "lisa" and if I try to select the rows with the
> statement "select * from lisa.com01" it works fine !
> But if I submit the statement "select * from com01" it
> return the error:
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'com01'.
> Why '
> In both cases I'm connected to the database with
> user "lisa" who is the owner of the table. There isn't
> other table called "com01" in the database.
> Help me please !!!
>|||HI
Read Books Online: object names -> Object Visibility and Qualification Rules
Andras Jakus MCDBA
"paolo" wrote:
> In my database I have created a table called "com01" owned
> by "lisa" and if I try to select the rows with the
> statement "select * from lisa.com01" it works fine !
> But if I submit the statement "select * from com01" it
> return the error:
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'com01'.
> Why '
> In both cases I'm connected to the database with
> user "lisa" who is the owner of the table. There isn't
> other table called "com01" in the database.
> Help me please !!!
>
>|||Thank you for your help Andras !
I've just read the documentation as you suggest me, but
unfortunately the problem is not solved:
"lisa" is the owner of the table "com01" and is the user
connected to the database, but if I want to select from
that table I've to specified the owner_name dot table_name
(lisa.com01) and not only the table_name (com01). Is the
same also for other tables owned by "lisa" !
If I try to select from table owned by "dbo" only with
table_name (sysobjects) it works fine !
"lisa" is db_owner of the database.
Any other suggestions '
Thank you!
Bye Paolo.
>--Original Message--
>HI
>Read Books Online: object names -> Object Visibility and
Qualification Rules
>Andras Jakus MCDBA
>"paolo" wrote:
>> In my database I have created a table called "com01"
owned
>> by "lisa" and if I try to select the rows with the
>> statement "select * from lisa.com01" it works fine !
>> But if I submit the statement "select * from com01" it
>> return the error:
>> Server: Msg 208, Level 16, State 1, Line 1
>> Invalid object name 'com01'.
>> Why '
>> In both cases I'm connected to the database with
>> user "lisa" who is the owner of the table. There isn't
>> other table called "com01" in the database.
>> Help me please !!!
>>
>.
>|||Bingo Dan ! "lisa" is a member of sysadmin role and the
statement "select user" return "dbo".
Is it possible to select from tables owned by "lisa"
without specified the owner ? I can't disable sysadmin
role for lisa !
Thank you !!!
Bye Paolo.
>--Original Message--
>Is 'lisa' a member of the sysadmin role? In this case,
the default owner
>will be 'dbo' instead of 'lisa' when resolving object
names. You can
>determine the name used for object name resolution with
SELECT USER.
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>"paolo" <paolo.ricci@.gidi.it> wrote in message
>news:746e01c494d7$50f799a0$a501280a@.phx.gbl...
>> In my database I have created a table called "com01"
owned
>> by "lisa" and if I try to select the rows with the
>> statement "select * from lisa.com01" it works fine !
>> But if I submit the statement "select * from com01" it
>> return the error:
>> Server: Msg 208, Level 16, State 1, Line 1
>> Invalid object name 'com01'.
>> Why '
>> In both cases I'm connected to the database with
>> user "lisa" who is the owner of the table. There isn't
>> other table called "com01" in the database.
>> Help me please !!!
>>
>
>.
>|||You could create a view
create view dbo.com01 as select * from lisa.com01
then
select * from com01
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"paolo" <paolo.ricci@.gidi.it> wrote in message
news:746e01c494d7$50f799a0$a501280a@.phx.gbl...
> In my database I have created a table called "com01" owned
> by "lisa" and if I try to select the rows with the
> statement "select * from lisa.com01" it works fine !
> But if I submit the statement "select * from com01" it
> return the error:
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'com01'.
> Why '
> In both cases I'm connected to the database with
> user "lisa" who is the owner of the table. There isn't
> other table called "com01" in the database.
> Help me please !!!
>|||Hopefully, Wayne's view suggestion will address your issue.
--
Hope this helps.
Dan Guzman
SQL Server MVP
<paolo.ricci@.gidi.it> wrote in message
news:75b501c494df$edd69f20$a301280a@.phx.gbl...
> Bingo Dan ! "lisa" is a member of sysadmin role and the
> statement "select user" return "dbo".
> Is it possible to select from tables owned by "lisa"
> without specified the owner ? I can't disable sysadmin
> role for lisa !
> Thank you !!!
> Bye Paolo.
>>--Original Message--
>>Is 'lisa' a member of the sysadmin role? In this case,
> the default owner
>>will be 'dbo' instead of 'lisa' when resolving object
> names. You can
>>determine the name used for object name resolution with
> SELECT USER.
>>--
>>Hope this helps.
>>Dan Guzman
>>SQL Server MVP
>>"paolo" <paolo.ricci@.gidi.it> wrote in message
>>news:746e01c494d7$50f799a0$a501280a@.phx.gbl...
>> In my database I have created a table called "com01"
> owned
>> by "lisa" and if I try to select the rows with the
>> statement "select * from lisa.com01" it works fine !
>> But if I submit the statement "select * from com01" it
>> return the error:
>> Server: Msg 208, Level 16, State 1, Line 1
>> Invalid object name 'com01'.
>> Why '
>> In both cases I'm connected to the database with
>> user "lisa" who is the owner of the table. There isn't
>> other table called "com01" in the database.
>> Help me please !!!
>>
>>
>>.

1 comment:

Anonymous said...

ur blog is really nice and interesting, You have maintain it so beautifully that I truly like & enjoy it
2003 Chrysler LHS AC Compressor

Post a Comment