Wednesday, March 7, 2012

Can't query attached database

Hello.
I received a detached database/log from my client. I attached the
database to my SQLServer 2000 SP3 installation just fine. In the
enterprise manager I can query any table I want.
However, when I attempt to query a table via the query analyzer, it
always fails, even though I am logged in as the "sa".
Below is my query and the result. I am not having this trouble with any
other database on the system.
select * from employee
Below is the error message:
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'employee'.
Any help would be appreciated.
Thanks,
Christian
pariahware@.pariahware.com
Pariahware, Inc. Custom Software and Shareware
http://www.pariahware.com
God loved you so much that He gave His only son Jesus.
What have you done with God's gift?
Is there really a table called employee? Are you in the right database? Who is the owner of that table?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Christian Miller" <pariahware@.pariahware.com> wrote in message
news:pariahware-434093.15550916062004@.news2-ge0.southeast.rr.com...
> Hello.
> I received a detached database/log from my client. I attached the
> database to my SQLServer 2000 SP3 installation just fine. In the
> enterprise manager I can query any table I want.
> However, when I attempt to query a table via the query analyzer, it
> always fails, even though I am logged in as the "sa".
> Below is my query and the result. I am not having this trouble with any
> other database on the system.
> select * from employee
> Below is the error message:
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'employee'.
> Any help would be appreciated.
> Thanks,
> Christian
> pariahware@.pariahware.com
> Pariahware, Inc. Custom Software and Shareware
> http://www.pariahware.com
> --
> God loved you so much that He gave His only son Jesus.
> What have you done with God's gift?
|||In article <uwTZNx9UEHA.1048@.TK2MSFTNGP09.phx.gbl>,
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote:

> Is there really a table called employee?
Yes, I can view it in the enterprise manager.

> Are you in the right database?
Yes, I've even used the "use" command to make sure, on occassion.

> Who is the owner of that table?
The owner of the table is "dbo".
When I look under the db's users, "dbo" is a name entry, "sa" is the
login name and access is "permit".
|||Try:
SELECT * FROM dbname.dbo.employee. Also, the server might be case-sensitive, make sure you use proper case.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Christian Miller" <pariahware@.pariahware.com> wrote in message
news:pariahware-21E05C.16194316062004@.news2-ge0.southeast.rr.com...
> In article <uwTZNx9UEHA.1048@.TK2MSFTNGP09.phx.gbl>,
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote:
> Yes, I can view it in the enterprise manager.
> Yes, I've even used the "use" command to make sure, on occassion.
> The owner of the table is "dbo".
> When I look under the db's users, "dbo" is a name entry, "sa" is the
> login name and access is "permit".
|||Try sp_helpsort to determine the the sort order.
"Christian Miller" <pariahware@.pariahware.com> wrote in message
news:pariahware-434093.15550916062004@.news2-ge0.southeast.rr.com...
> Hello.
> I received a detached database/log from my client. I attached the
> database to my SQLServer 2000 SP3 installation just fine. In the
> enterprise manager I can query any table I want.
> However, when I attempt to query a table via the query analyzer, it
> always fails, even though I am logged in as the "sa".
> Below is my query and the result. I am not having this trouble with any
> other database on the system.
> select * from employee
> Below is the error message:
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'employee'.
> Any help would be appreciated.
> Thanks,
> Christian
> pariahware@.pariahware.com
> Pariahware, Inc. Custom Software and Shareware
> http://www.pariahware.com
> --
> God loved you so much that He gave His only son Jesus.
> What have you done with God's gift?

No comments:

Post a Comment