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
 SQL Server Administration (2005)
 BCP error

Author  Topic 

sqlserverdba
Yak Posting Veteran

53 Posts

Posted - 2009-05-01 : 15:17:48

Hi,
I'm getting following errors.
C:\DS\data>bcp LAB.PS.test out c:testdata.bcp -n -Usa -P<PASSWORD>

SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a con
nection 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.

Please advice.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-05-01 : 15:21:16
I don't see the -S switch in your command.

Here's an example:
bcp db1.dbo.table1 out c:\table1.csv -Sserver1\instance1 -n -Usa -Psapassword

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

sqlserverdba
Yak Posting Veteran

53 Posts

Posted - 2009-05-01 : 16:22:44
Work fine backup but having issue during restore.

C:\DS\data>bcp testd.dbo.Table_1 in c:\ds\table_1.csv -S<SERVERNAME> -n -Utestsys -Ptestsys

SQLState = 42S02, NativeError = 208
Error = [Microsoft][SQL Native Client][SQL Server]Invalid object name 'testd.dbo
.Table_1'.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-05-01 : 16:45:54
Well you probably will need PS instead of dbo in the command. I used dbo as an example, change my example to whatever is appropriate in your environment.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -