Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 bcp copy

Author  Topic 

-Dman100-
Posting Yak Master

210 Posts

Posted - 2007-11-14 : 00:21:42
I am running SQL Server Management Studio Express 2005. I am trying to bulk copy the contents of a csv file into a table. I've opened the command window and typed in the following:

bcp "Public_data.dbo" in "c:\customer_service_reportcard.csv" -c -q -U"xxxxxx" -P"xxxxxxx"

I get the following error:
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.

SQLServer Management Studio Express is installed on my local PC for development. Does bcp work with Express?

I checked the server properties and "allow remote connections to this server" is checked.

Any help is appreciated.

-Dman100-
Posting Yak Master

210 Posts

Posted - 2007-11-14 : 02:00:56
I finally figured it out...for those that come across a similar issue with Express. You have to specify the server:

bcp DatabaseName.dbo.TableName in c:\filename.csv -c -q -S ServerName\SQLExpress -U xxxxxxx -P xxxxxx -t \t -r \n
Go to Top of Page

RonTaylor503
Starting Member

1 Post

Posted - 2011-06-14 : 20:12:18
Dude! This totally helped. Thanks for taking the time to post!
Go to Top of Page
   

- Advertisement -