Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase «««12345

order of rows during bulk insert Expand / Collapse
Posted Tuesday, March 18, 2014 5:08 AM


Group: General Forum Members
Last Login: Sunday, November 27, 2016 9:43 AM
Points: 458, Visits: 3,706
awez1411 (3/18/2014)

its properly work 3 times but at 4 or 5th time when i use bulk insert command all data are successfully inserted into table but it lost the sequence.

after 1136th row 201545th row added and break all the sequence

Please Give me Proper Solution for that.


What do you mean by "lost the sequence"? How are you determining what the sequence is? Tables have no inherent sequence and insertion order is not something you can determine just by looking at the data in a table. The way to order a table is using an ORDER BY clause in your SELECT statement.

In your case it looks like you have an IDENTITY column and you are using the KEEPIDENTITY option to insert those values directly from the file. Are you saying the IDENTITY column values don't match the data in the file?
Post #1552102
Posted Tuesday, May 26, 2015 9:05 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, May 26, 2015 8:58 PM
Points: 8, Visits: 28
I had the same problem. I created the SQL table with an identity column and made it the primary key. Then create a view on the empty table. Then make the destination of the bulk insert the view. It worked for me. Hope this helps.
Post #1688905
« Prev Topic | Next Topic »

Add to briefcase «««12345

Permissions Expand / Collapse