use a format file e.g.
Code:
1> create table t1 (c1 char(3), c2 int, c3 varchar(100))
2> go
$ cat t1.txt
"NY",2,"New York, USA"
"II",1,"India"
"GP",3,"Gauteng, RSA"
$ cat t1.fmt
10.0
4
1 SYBCHAR 0 100 "\"" 0 junk1
2 SYBCHAR 0 100 "\"," 1 data1
3 SYBCHAR 0 100 ",\"" 2 id
4 SYBCHAR 0 100 "\"\n" 3 address
$ bcp tempdb..t1 in t1.txt -Usa -P -Smysrv -f t1.fmt -e t1.err
Starting copy...
3 rows copied.
Clock Time (ms.): total = 1 Avg = 0 (3000.00 rows per sec.)
1> select * from t1
2> go
c1 c2 c3
--- ----------- -----------------------------------------------
NY 2 New York, USA
II 1 India
GP 3 Gauteng, RSA
(3 rows affected)
1> drop table t1
2> go