-1

I'm stuck at a very simple bcp and am hoping someone here could tell what i am doing wrong... I have a single column textfile contaning email addresses. I'm trying to BCP this to SQL server using "bcp" command. Below is the sample file and the command I'm using.

I have used bcp before with different sets of files, but never had an issue. Any idea why this file wouldn't load?

D.out
'a@a.com'
'b@b.com'
'c@c.com'

bcp command: 
bcp temp_sf_email in D.out -SMyDBServer\INSTANCEA -T -w

Looks basic. But when run, doesnt do anything. The output I got is: Starting Copy..... 0 Rows copied.

Thanks in advance for any suggestions.. Regards, Simak

BRZ
  • 695
  • 4
  • 13
  • 25

1 Answers1

1

I would like to suggest this sintax for BCP command

bcp db_name.schema_name.table in "drive:\folder\file.ext" -SServer -T -c

example for your case:

bcp yourdb.dbo.temp_sf_email in "c:\folder\D.out" -SMyDBServer\INSTANCEA -T -c

use the flag -c that means -c character type instead -w

for more info about BCP click here

NOTE: I tested this example in SQL2005 and it work, btw you didnt specificy which SQL version was used

Hope it help

Luka Milani
  • 1,541
  • 14
  • 21