November 18, 2008 at 10:45 am
I am trying to write a CSV file from my SQL Server database. I am using the query:
DECLARE @bcpCommand varchar(2000)
SET @bcpCommand = 'bcp " SELECT ISBN, Condition, SKU, SKY FROM [MyDatabase].dbo.booklist" queryout g:\temp\output.csv -c -CACP -t, -T'
EXEC master..xp_cmdshell @bcpCommand
I am getting the error message:
SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2].
SQLState = HYT00, NativeError = 0
Error = [Microsoft][SQL Native Client]Login timeout expired
SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connecti
ons.
NULL
I have checked and the access is set up for local and remote connections using both TCP/IP and named pipes.
November 18, 2008 at 9:50 pm
You still have to identify the server and, maybe the instance using the -S parameter.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply