I am trying to import data to a table and need some help. After researching a bit, I decided to use BULK INSERT and a format file to import the data.
The data is in a comma delimted file with the " marks as a text qualifier. I'm not having any luck importing the data so I made a table with a single column set as a VARCHAR(50) for testing. I made a format file which contains:
9.0
1
1 SQLCHAR 0 4 "\r\n" 1 fldTrans ""
My test data file has 1 column and looks like this:
"RED"
"BLUE"
When I execute my procedure and it says it's completed successfully. The code is:
BULK INSERT tblTest
FROM 'F:\Files\Data.Txt'
WITH (FORMATFILE = 'F:\Files\Data.Fmt')
Is there any easier way to get data into SQL 2005 Express? Am I on the right track?
Thanks in advance,
mapman04
The data is in a comma delimted file with the " marks as a text qualifier. I'm not having any luck importing the data so I made a table with a single column set as a VARCHAR(50) for testing. I made a format file which contains:
9.0
1
1 SQLCHAR 0 4 "\r\n" 1 fldTrans ""
My test data file has 1 column and looks like this:
"RED"
"BLUE"
When I execute my procedure and it says it's completed successfully. The code is:
BULK INSERT tblTest
FROM 'F:\Files\Data.Txt'
WITH (FORMATFILE = 'F:\Files\Data.Fmt')
Is there any easier way to get data into SQL 2005 Express? Am I on the right track?
Thanks in advance,
mapman04