0

SQL bulk insert using bcp between servers through script without using linked server.

I'm trying to use the following queries:

bcp AdventureWorks.dbo.BuildVersion out Currency.dat -U sa -P 123456 -c -[cespl-pc130]

bcp AdventureWorks.dbo.BuildVersion in Currency.dat -U sa -P 123456 -c -[cespl-pc83]

I am getting the following error:

Msg 102, Level 15, State 1, Line 1 Incorrect syntax near '.'.

Is it the right way to do?

Explain the possibilities to do the bulk data transfer between servers.

gniourf_gniourf
  • 44,650
  • 9
  • 93
  • 104
venkat
  • 178
  • 2
  • 12

1 Answers1

0

try this:

SELECT a.*
FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
     'SELECT col1,col2,col3..
      FROM AdventureWorks.dbo.BuildVersion 
      ) AS a;

Here you need to provide your server name from where you want to copy the data.And run this above query in your destination server.

AnandPhadke
  • 13,160
  • 5
  • 26
  • 33