Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
alejo46
Posting Yak Master
157 Posts |
Posted - 2013-07-06 : 14:28:09
|
Good afternoonIm 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 = 8180This 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 -TThe server name is datamartsql and the table does really exist in the schema:select @@servernameOuput:DATAMARTSQLexec sp_spaceused SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOSOutput:SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS 2147483647 882216720 KB 553476280 KB 240438240 KB 88302200 KBI'd appreciate your help in advanced please |
|
alejo46
Posting Yak Master
157 Posts |
Posted - 2013-07-06 : 17:48:47
|
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_SALDOSbut i would like to know why bcp doesn't recognize the sentence dm1_elite.SALDOS_PREPAGO_DIARIOS_ALTAMIRA_SALDOS ? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-07-23 : 05:16:24
|
If dm1_elite is db name, you need to use three part name dbname.ownername.objectnameMadhivananFailing to plan is Planning to fail |
|
|
|
|
|