BCP to text failing [shared memory] invalid instance

When I run this code...

DECLARE @bcpCommand varchar(2000)
SET @bcpCommand = 'bcp sp_text out test.txt -c -U -P'
EXEC master..xp_cmdshell @bcpCommand

I get this...

SQLState = 08001, NativeError = 14
Error = [Microsoft][ODBC SQL Server Driver][Shared Memory]Invalid connection.
SQLState = 01000, NativeError = 14
Warning = [Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (Invalid Instance()).
NULL

What on earth does it mean !

Thx,

Nick



Answer this question

BCP to text failing [shared memory] invalid instance

  • KB Sherman

    Since you didn't specify the -S or server parameter BCP will try to connect to a default instance of SQL Server on the machine running the BCP utility. In this case, it seems like there is either no SQL Server default instance installed or the shared memory protocol is disabled. So please specify the server to which you want to connect and it should be fine.

  • BCP to text failing [shared memory] invalid instance