Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 bcp error
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

157 Posts

Posted - 07/06/2013 :  14:28:09  Show Profile  Reply with Quote
Good afternoon
Im trying to use bcp to queryout rows of a table with a where condition and yielded an error:
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS'.
SQLState = 37000, NativeError = 8180

This is the query:
bcp "SELECT * FROM dm1_elite.SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS where FEC_SALDO >= '20120816'and FEC_SALDO <= '20120831'" queryout c:\prueba.txt -c -t"|" -Sdatamartsql -T

The server name is datamartsql and the table does really exist in the schema:
select @@servername
SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS 2147483647 882216720 KB 553476280 KB 240438240 KB 88302200 KB

I'd appreciate your help in advanced please

Posting Yak Master

157 Posts

Posted - 07/06/2013 :  17:48:47  Show Profile  Reply with Quote
Now its working, because i add to the schema name DBO, so, instead of bcp "SELECT * FROM dm1_elite.SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS i replace bcp "SELECT * FROM dm1_elite.DBO.SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS

but i would like to know why bcp doesn't recognize the sentence dm1_elite.SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS ?
Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 07/23/2013 :  05:16:24  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
If dm1_elite is db name, you need to use three part name dbname.ownername.objectname


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000