Friday, February 24, 2012

bulk insert

Hi there !
a pretty silly question about bulk insert...
i'm trying to insert data into a table, but the first field is
quotation marked..so I wrote this in the fileformat
8.0
2
1 SQLCHAR 0 0 "" 0
dum1
2 SQLCHAR 0 50 "\"" 1
px_orig SQL_Latin1_General_CP1_CI_AS
where px_orig is the name of my field..
Whan I try to bulk insert using this, I get this error:
Cannot perform bulk insert. Invalid collation name for source 1 in
format file '...etc'
any idea'
thanks a lot...
++
VinceYou need to specify the leading quote as well as the row terminator in the
format file. Try something like:
8.0
3
1 SQLCHAR 0 0 "\"" 0 quote ""
2 SQLCHAR 0 50 "\"" 1 px_orig
SQL_Latin1_General_CP1_CI_AS
3 SQLCHAR 0 0 "\r\n" 0 crlf ""
Hope this helps.
Dan Guzman
SQL Server MVP
"Vince .>" <vincent@.<remove> wrote in message
news:guai41dtlfg3qfi3ad7o6s9rpmt7f5afq4@.
4ax.com...
> Hi there !
> a pretty silly question about bulk insert...
> i'm trying to insert data into a table, but the first field is
> quotation marked..so I wrote this in the fileformat
> 8.0
> 2
> 1 SQLCHAR 0 0 "" 0
> dum1
> 2 SQLCHAR 0 50 "\"" 1
> px_orig SQL_Latin1_General_CP1_CI_AS
> where px_orig is the name of my field..
> Whan I try to bulk insert using this, I get this error:
> Cannot perform bulk insert. Invalid collation name for source 1 in
> format file '...etc'
> any idea'
> thanks a lot...
> ++
> Vince|||thanks :)

No comments:

Post a Comment