none
order of records inserted in sql table

    Question

  • I have a flat file to insert into a sql table maintaining the order of data in file. I need it so I can clean dirty data in coming through the file. I can have data in a file as following,

    Column0   Column1    Column2

    a               b                c

    d               e                f

    Column0    Column1    Column2

    p               q                 r

    s               t                 u

    As this single file consists of multiple headers, I have to only keep the records after the second header. To do that I was thinking of inserting the data into table with identity column and then finding the max id where the header is and taking only the records after that. But I am not sure whether that works because I am not sure whether SQL Server maintains the order of records the file has while doing the bulk insert using SSIS.

    Is there any other solution ?

    Wednesday, July 24, 2013 8:15 PM

Answers