I have a 38 column table that I am trying to write a sproc that will insert a text file into it. I have been doing this via dts, but want to do it in tsql.
The text data looks like this:
"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","000097170","","","","","","D"
a double-quote, one space, another double quote, and then the comma denote an empty string.
when I use this code to import the data:
BULK INSERT TNBLRaw.dbo.L011558100_20020515
FROM '\\tnbl\d\test\test1.raw'
WITH ( ROWTERMINATOR = '\n',
DATAFILETYPE = 'char',
CODEPAGE = 'raw',
FieldTerminator = '","')
The data is imported fine except for a double quote which is inserted into the first column.
Is there a way to get that double quote out of the first column? Why do I not have this problem when I use DTS to copy the file in via a data pump?
The text data looks like this:
"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","000097170","","","","","","D"
a double-quote, one space, another double quote, and then the comma denote an empty string.
when I use this code to import the data:
BULK INSERT TNBLRaw.dbo.L011558100_20020515
FROM '\\tnbl\d\test\test1.raw'
WITH ( ROWTERMINATOR = '\n',
DATAFILETYPE = 'char',
CODEPAGE = 'raw',
FieldTerminator = '","')
The data is imported fine except for a double quote which is inserted into the first column.
Is there a way to get that double quote out of the first column? Why do I not have this problem when I use DTS to copy the file in via a data pump?