Search code examples
sql-serverbcp

Trouble geting BCP to work on local server


This is driving me mad...

SQL Server 2008 R2 Developer Edition installed.

Attempting to BCP to a file from the command line.

bcp MyDb..MyTable out MyTable.dat -T

Get the error:

CTLIB Message: - XX/XX/XX/XX/X/X:
ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
Establishing connection failed.


Solution

  • Turns out Sybase is installed on these corporate desktops and gets path priority over SQL. When I ran BCP from the command line it was running Sybase BCP!

    The answer to is specify the BCP path for SQL. Now it works fine.