Quick one today, I was playing with BCP trying to replicate a production issue on my new local machine and kept running into the below error even when running the most basic BCP command:

bcp demo.dbo.export out c:\temp\text.txt -T -C -S MyPC

CTLIB Message:  – L6/O8/S5/N3/5/0:
ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
Establishing connection failed.


The error is caused by having a sybase database installed on the machine. The resolution is to either uninstall sybase if you dont need it! or when calling the SQL instance on the same server as sybase call the port as well like below:

bcp demo.dbo.export out c:\temp\text.txt -T -C -S MyPC:1433