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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 7 ID PROBLEM URGENT

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I have a problem with the order of the numeric ID in several of my tables in one database.
Basically every quarter, using link table i update the figures in my table using basic cut and paste. However this will not work now as the table has become out of order due to the ID'S not beeing in numeric order.example
ID
1
7
23
24
15
16
2
3
8
34

I am desperate to get these collums back into order so i can paste my data in how do i do this. i want it to be like this

ID
1
2
3
4
5
ECT

PLEASE HELP

THANKS


 
This SQL stmt will sort by id.

select * from table order by ID

Is this what you want?
 

Order is irrelevant in a relational database. As mentioned you can always sort with an order by clause in a query. If you think you need the data in the order of the ID column, create a clustered index on the ID column. SQL server will order the data in that sequence. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top