bcp Command not working

Hi

Please can someone help....

I am trying to extract bcp files from a folder, however its not working:

C:\bcp Juliansql.dbo.extract_acct_submit out C:\bcpexport\extra
ct_acct-Submit.txt -T -c

What am I doing wrong?

Help please.........

Thanks




September 8th, 2015 11:16am

What error do you get?
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 11:29am

1.Try to find out where the bcp.exe installed.

    Start--->search bcp ----> get the bcp installed location(right click on bcp will get path where the bcp installed)

2.click Start--->in search window type  CMD -->enter----> change the directory to bcp installaed location.

   example: E:\sqlserver\sql\bcp.exe  ( then change directory to "E:\sqlserver\sql")

cd E:\sqlserver\sql  (hit enter)  then run below command.

bcp [DB_Name].[dbo].[Table_Name] out "C:\Tmp\BCP_out.txt" -T -c

thanks

September 8th, 2015 11:44am

Hi Arthur

The error received is: 

SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could no
t open a connection to SQL Server [2].
SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Server Native Client 11.0]A network-related or instance-
specific error has occurred while establishing a connection to SQL Server. Serve
r is not found or not accessible. Check if instance name is correct and if SQL S
erver is configured to allow remote connections. For more information see SQL Se
rver Books Online.
SQLState = S1T00, NativeError = 0
Error = [Microsoft][SQL Server Native Client 11.0]Login timeout expired

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 12:40pm

Use UDL to check connectivity and ultimately its connection string to connect as


bcp Juliansql.dbo.extract_acct_submit out C:\bcpexport\extra
ct_acct-Submit.txt -T -c -U<login_id> -P<password> -S<server_name\instance_name>

September 8th, 2015 1:49pm

Hi,

You forgot to specify the SQL server instance as -S servername\instancename

If you don't specify it, bcp will connect to default instance on your own PC.

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 2:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics