• Hi,

    When a bulk insert is done from a flat file or a xls file, how do u ensure the rows are added in the same order as they are in the xls file?

    Basically, I want to load the data into a table which has an identity column which would need to store the rownumber of each record in the original flat file or xls file.

    Thanks.

    Create a sequential key in the spreadsheet and bulk insert with identity insert on.

    We need to migrate data from a ms access db to sql server. As ms access preserves the records in the order in which they were actually inserted, and the application logic depends on it (the last() function in ms access) , we need to maintain the same order in the sql server db.

    So, we thought of having an identity col which can be used for replicating the last() functionality in ms access.

    The problem is, while migrating the existing data, the id column should be the actual position of that record in the original ms access db.

    Why not use the database upgrade wizard to put it in SQL for you?