dbTalk Databases Forums  

BULK INSERT row terminator

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss BULK INSERT row terminator in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
joshsackett
 
Posts: n/a

Default BULK INSERT row terminator - 05-05-2005 , 09:07 AM






Hello all,
I have a multiple text files with an odd row terminator. If you were to
examine it in VB it would be like a "CrCrLf" instead of just "CrLf". In
HEX it is DDA instead of just DA. When I am trying to import into my
table using BULK INSERT I use "\n" as the row terminator but that is
putting the the previous character into the column and then it signals
a carriage return when I attempt to query the data.

Any suggestions on what I should use as the row terminator? Is it
possible to tell BULK INSERT to use something like "CHAR(10)\n"?

"\n\n" does NOT work.

Thanks in advance.


Reply With Quote
  #2  
Old   
joshsackett
 
Posts: n/a

Default Re: BULK INSERT row terminator - 05-05-2005 , 09:44 AM






I found it!
"\r\n" works like a charm.. "\r" is for carriage return only.. I'm
surprised I didn't already know that.

I found the answer here:
http://www4.dogus.edu.tr/bim/bil_kay...65dba/ch16.htm

under table:
Table 16.4. Valid field terminators.
Terminator Type Syntax
tab \t
new line \n
carriage return \r
backslash \\
NULL terminator \0
user-defined terminator character (^, %, *, and so on)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.