Home All Groups Group Topic Archive Search About

bcp invalid object name

Author
27 Jun 2006 4:42 PM
Mike
I have a bcp command

bcp xxxxx.FASTECHTIME.EmpEvals out
C:\EmpEvalsDue.txt -STime -Uxxxxx -Pxxxxxxxxxxx

for which I receive the error

SQLState = 37000, NativeError = 4060
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
requested in login 'xxxxx'. Login fails.

The other error I get is

SQLState = S0002, NativeError = 208
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'FASTECHTIME.EmpEvals'.

The server is Time, the database is FASTECHTIME, and the table is EmpEvals.

What is the proper way to code access to the object? I have tried

EmpEvals
FASTECHTIME.EmpEvals
xxxxx.FASTECHTIME.EmpEvals


TIA.

Mike

Author
27 Jun 2006 6:55 PM
Kalen Delaney
Hi Mike

A full object qualification is database_name.object_owner.object

What is xxxxx?

You need to have the owner in between the db and the object, so if the user
dbo is the owner, you would specify as:

FASTECHTIME.dbo.EmpEvals

or, since dbo is one of the default owners, you can leave it out, but you
still need the two dots:

FASTECHTIME..EmpEvals

--
HTH
Kalen Delaney, SQL Server MVP


Show quote
"Mike" <mav***@shoremortgage.com> wrote in message
news:OyTDWkgmGHA.2204@TK2MSFTNGP03.phx.gbl...
>I have a bcp command
>
> bcp xxxxx.FASTECHTIME.EmpEvals out
> C:\EmpEvalsDue.txt -STime -Uxxxxx -Pxxxxxxxxxxx
>
> for which I receive the error
>
> SQLState = 37000, NativeError = 4060
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open
> database requested in login 'xxxxx'. Login fails.
>
> The other error I get is
>
> SQLState = S0002, NativeError = 208
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
> 'FASTECHTIME.EmpEvals'.
>
> The server is Time, the database is FASTECHTIME, and the table is
> EmpEvals.
>
> What is the proper way to code access to the object? I have tried
>
> EmpEvals
> FASTECHTIME.EmpEvals
> xxxxx.FASTECHTIME.EmpEvals
>
>
> TIA.
>
> Mike
>
>
>

AddThis Social Bookmark Button