Jeff Moden (2/8/2016)
mxy (2/8/2016)
Thanks it worked let me work on first set of data in the file.Thanks again for your time.
How? When I try to load the file with Luis' code, I get the following...
Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'ShipmentTrackingID', table 'tempdb.dbo.#ShipmentContents___________________________________________________________________________________________________000000000006'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The header information in the file is the problem and the "first row" of 2 doesn't contain enough columns of data to offset things.
Jeff, the DDL needs to be changed to make ShipmentTrackingID nullable as this is not available in the file. Making that change, the header information causes no problem.