We help IT Professionals succeed at work.

how to pass initial catalog parameter to bcp

dionisio_79
dionisio_79 asked
on
Hi Experts,
can I pass the initial catalog as a parameter to my bcp?
Comment
Watch Question

Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009

Commented:

Author

Commented:

bcp "select * from dbo.app_bretella" queryout "C:\Documents and Settings\EE20019\My Documents\we.txt " -t ; -S ...SERVERNAME -d ...DATABASENAME -U secretoUR -P secretoUR -c
i GET AN UNKNOWN OPTION -d
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009

Commented:
are you sure you are using the SQL Server bcp, and don't have another bcp in the "path"?
that's what I have seen as usual reason for this "error"

Author

Commented:
sure, no other bcp executables in the path
Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
I notice you have spaces between the option names and the values, can you please try without those spaces:
bcp "select * from dbo.app_bretella" queryout "C:\Documents and Settings\EE20019\My Documents\we.txt " -t; -S...SERVERNAME -d...DATABASENAME -UsecretoUR -PsecretoUR -c

Open in new window

Author

Commented:
tryied without spaces, same result

Author

Commented:
any other suggestions?
Guy Hengel [angelIII / a3]Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
can you please show the output of:
bcp

so, without parameters ?