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:
> > 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".|||In article
<pariahware-21E05C.16194316062004@.news2-ge0.southeast.rr.com>,
Christian Miller <pariahware@.pariahware.com> wrote:
> 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".
OK, apparently there is not a database table called "employee", but
there is one called "EMPLOYEE". I don't ever remember table name case
being an issue when performing a querying before. I normally uppercase
key words and lowercase table names. Is this a setting in my SQL Server
that I accidentally set?
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?|||Case sensitivity for object names is based on the database collation (if my memory serves me).
--
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-11C0F9.16271516062004@.news2-ge0.southeast.rr.com...
> In article
> <pariahware-21E05C.16194316062004@.news2-ge0.southeast.rr.com>,
> Christian Miller <pariahware@.pariahware.com> wrote:
> > 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".
> OK, apparently there is not a database table called "employee", but
> there is one called "EMPLOYEE". I don't ever remember table name case
> being an issue when performing a querying before. I normally uppercase
> key words and lowercase table names. Is this a setting in my SQL Server
> that I accidentally set?
>
> 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 <u2N$QN#UEHA.2920@.TK2MSFTNGP10.phx.gbl>,
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote:
> Case sensitivity for object names is based on the database collation (if my
> memory serves me).
If that per database file or per server? How would I turn off database
collation if I wanted to? I really appreciate all the help on this.
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?|||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