Re: specifying a non printable ascii value as the field terminator
From: Mark (anonymous_at_discussions.microsoft.com)
Date: 07/28/04
- Previous message: pohkeat: "SQL Profiler advise needed"
- In reply to: Steve Kass: "Re: specifying a non printable ascii value as the field terminator"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Jul 2004 12:51:51 -0700
The only non-printable characters are the field and row
terminators themselves. Everything else is regular ascii
characters. The import works fine also with the sample I
showed, I just want to be able to change the blocks to
something that is easier to read.
>-----Original Message-----
>Mark,
>
> Even if you could specify it (which I don't think you
can), I wouldn't
>recommend trying to import a "text" file with
nonprinting characters - it's
>basically not a text file and might not be handled
correctly. You would be
>better off running the file through some utility to
replace the terminators
>with something else - hopefully there is some printing
character that is not
>in your file (and you could use a similar utility to
find out). I've found
>the Cygwin open source Unix shell for Windows to be an
excellent tool for
>this kind of thing.
>
>Steve Kass
>Drew University
>
>"Mark G." <anonymous@discussions.microsoft.com> wrote in
message
>news:545601c4741e$0774c2f0$a301280a@phx.gbl...
>I am trying to execute the following:
>
>BULK INSERT mytable FROM 'C:\mydata.txt'
>WITH (
> DATAFILETYPE = 'char',
> FIELDTERMINATOR = '',
> ROWTERMINATOR = ''
>)
>
>The field terminator is ascii value 1 and the row
>terminator is ascii value 2. Rather than pasting in the
>actual ascii representations which shows up as a box, I
>would like to be able to specify the values using a
>control character or even CHAR function. I have tried all
>of the following ways and none work:
>
> FIELDTERMINATOR = '0x01',
>
> FIELDTERMINATOR = 0x01,
>
> FIELDTERMINATOR = CHAR(1),
>
> DECLARE @field varchar(1)
> SET @field = CHAR(1)
> FIELDTERMINATOR = @field,
>
>So does anybody have any other ideas how to specify ascii
>values 1 & 2 for field and row terminators?
>
>
>
>
>.
>
- Previous message: pohkeat: "SQL Profiler advise needed"
- In reply to: Steve Kass: "Re: specifying a non printable ascii value as the field terminator"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|