Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
w1102157
Yak Posting Veteran
80 Posts |
Posted - 2012-08-01 : 14:32:15
|
| HI guysIs there any way i can important data from a flat file and keep the order of the data the same?The order of the data is odd but i need this order to stay the same in the sql table.is there any way? |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-08-01 : 14:34:00
|
There is never a reliable order of rows in a table. To get rows in a needed order you have to use ORDER BY in your select statement. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-01 : 14:34:30
|
| yep...you can . just add an identity column in sql tableand you can retrieve it in order you inserted based on identity value generated------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
w1102157
Yak Posting Veteran
80 Posts |
Posted - 2012-08-01 : 14:35:11
|
| i cant do that it wont work fro example i import data from a pipe file and the id order is 357126i need the table to keep it this way :( |
 |
|
|
w1102157
Yak Posting Veteran
80 Posts |
Posted - 2012-08-01 : 14:35:49
|
| visakh how can i do this? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-08-01 : 16:11:24
|
quote: Originally posted by w1102157 visakh how can i do this?
as i suggested dump data onto table with additional identity column and then while retrieving useORDER BY ID------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|