Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCP Newbie needs help

Status
Not open for further replies.

MMund

Programmer
Oct 9, 2007
57
CA
Trying to export to an sdf file with BCP

Using the following code snippets

Code:
set @as_select = 'bcp "select * from ct_rl2cpcs"'
set @as_bcp = @as_select + ' queryout E:\hrsql\Totalhr.430\cpcs\rl2cpcs.txt -T -w -N'
exec master.dbo.xp_cmdshell @as_bcp

And this is what I get back:

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 connections.
NULL

Think this could be a server settings issue?

TIA,
MMund
 
Hi,

If you are trying to get a complete extract of the table you will need to make your first line

Code:
set @as_select = 'bcp "[i]DATABASENAME[/i]..ct_rl2cpcs"'

where DATABASENAME is the database which holds the ct_r12cpcs table.


Hope it helps

**************************************************************
Rock is Dead (Long Live Paper and Scissors)
**************************************************************
 
Still getting the error, however since the last post, I found out from our server admin that pipes have been disabled, and that only a TCP/IP connection will be allowed. Anyone have an ideas as to how to get around this?

TIA,

MMund
 
Had the server admin enable named pipes, but still get the error, so pipes apparently wasn't the issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top