I am using the BCP utility to copy data from a table in a local database to a network share with the following command:
BCP "SELECT Id, InvoiceNo, Status, ErrorDescription, FileName, IsNull(ModifiedBy,'NU7') AS ModifiedBy, ModifiedOn FROM MyDB.dbo.MyTable WHERE IsDeleted = 0 AND BatchNo IN ('20210723','20210730')" queryout \11.11.144.77\ftp\DataStore\BulkCopy\MyTableNU7.dat -T -n
This command is assigned to a VarChar(MAX) variable named @Cmd and executed as follows from a stored procedure:
EXEC master..xp_cmdshell @Cmd
I am getting the following errors:
SQLState = 08001, NativeError = 2
Error = [Microsoft][ODBC Driver 17 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [2].
SQLState = 08001, NativeError = 2
Error = [Microsoft][ODBC Driver 17 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is config
ured to allow remote connections. For more information see SQL Server Books Online.
SQLState = S1T00, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired
I am at my wit's end trying to figure this out. Could someone please help me?
Thanks in advance!