How do you specify field lengths with the Bulk Insert command?
Example: If I had a table named c:\Temp\TableA.txt and it had:
123ABC
456DEF
And I had a table such as:
use tempdb
CREATE TABLE TABLEA(
Field1 char(3),
Field2 char(3)
)
BULK INSERT TableA FROM 'C:\Temp\TableA.txt'
SELECT * FROM TableA
Then how would I specify the lengths for Field1 and Field2?
I think you need to define a format file
e.g.
For that to work, though, you need a Format File, obviously.
See here for general info about creating one:
Creating a Format File
At a guess, from looking at the Schema, something like this might do it: