views:

56

answers:

2

I use SQL Server wizard to import csv files, however the rows imported appears in different order. How can I say to SQL Server to import rows in correct order.

+2  A: 

It's probably importing in the correct order, but SQL server is retrieving them in a different order. Try adding a unique column on your table and then select the rows using that as an order by.

Dayton Brown
+4  A: 

In databases there is no such thing as order of records, as opposed to numbered spreadsheet rows, you need a column to order by. You would use something like

SELECT * FROM myTable ORDER BY SomeColumn
Damir Sudarevic
+1, but for databases, you are really meaning "relational databases" as defined by E.F. Codd, since before and since there have been databases of other kinds.
Cade Roux