September 9, 2014 at 3:41 pm
Hello everyone,
I want to ensure something. I must insert some files in my SQL Server Database. I use the traditional way. Oledb connection to SQL Server and fast load. I also have added an identity column ( INT IDENTITY (1,1) ) to have an ordering 1,2,3 etc.
My question is: Are the rows in the database (destination) in the same order imported as they are in the files? Does the identity column that I have added, help me to have the right order? I checked some data and to be honest I see the exact same ordering as it is in the files... But I must 100% sure. I think about to add an identity column to the files but I know it's not the best practice... I am really thankful for any advice.
Please help! 🙂
Thank you a lot!
September 10, 2014 at 1:01 am
Tables don't have an order.
The identity might help if you put a clustered index on it and if all the queries on the table use ORDER BY ID.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
September 10, 2014 at 1:29 am
rena24 (9/9/2014)
Hello everyone,I want to ensure something. I must insert some files in my SQL Server Database. I use the traditional way. Oledb connection to SQL Server and fast load. I also have added an identity column ( INT IDENTITY (1,1) ) to have an ordering 1,2,3 etc.
My question is: Are the rows in the database (destination) in the same order imported as they are in the files? Does the identity column that I have added, help me to have the right order? I checked some data and to be honest I see the exact same ordering as it is in the files... But I must 100% sure. I think about to add an identity column to the files but I know it's not the best practice... I am really thankful for any advice.
Please help! 🙂
Thank you a lot!
It would be better to add a row number to your source data and insert that to your target table, just to be sure. You cannot guarantee that your method will always work.
Or have a look here[/url] for an example of how to create a row number as the data passes through the SSIS pipeline.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
September 10, 2014 at 5:48 am
Hello everyone and thank you for the Answers!
Phil your solution is great!!! Thats exacrly what I need! Quick and clear!
Thank you very very much!
September 10, 2014 at 6:16 am
rena24 (9/10/2014)
Hello everyone and thank you for the Answers!Phil your solution is great!!! Thats exacrly what I need! Quick and clear!
Thank you very very much!
🙂 Thanks for posting back with the nice feedback.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
September 10, 2014 at 6:39 am
You saved me! Thank you again! :-):-):-)
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply