Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Order and Sequence

Status
Not open for further replies.

dickylam

IS-IT--Management
Jun 24, 2001
86
I have a question,

if I select and open a table under a database with any order specified.

How and what happen if I perform a test loop to insert 50 records, for example in the sequence.

I found that the records are locating some at the top, some at the middle and some at the end, it seems not in sequential, what will be the reason ?

Also, is it necessary to use with index and I do not have query ?

Tks
 
By definition.

SQL Server does not store records in a particular order.

If you need records in an order you must specify an order by clause in the query.

Any results where you do not use order by and the results happen to come out in the order you wanted them in should be considered dumb luck and not be relied on. As many people who did not observe the above rule found out when they migrated from SQL 7 to 2000.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top