Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««12345

order of rows during bulk insert Expand / Collapse
Author
Message
Posted Tuesday, March 18, 2014 5:08 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, July 19, 2015 2:00 AM
Points: 455, Visits: 3,618
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.


Hi,

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