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

Sorting Numeric values in table

Status
Not open for further replies.

lbunch

Programmer
Sep 5, 2006
120
US
I have column Rpt_ID that is numberic - when I add numeric values by adding new rows - the column does not resort to show numberic order. There is not a primary key and I cannot add one to the table. Is there a way to fix??
 
Tables without a PK (clustered index) are called heap tables. If you google heap tables there is a lot of good information out there. There is no way to sort the data in a heap table. If the numeric value is unique you could create clustered index on it to resort the data then drop it.

- Paul
- Database performance looks fine, it must be the Network!
 
Any column can be sorted, but you must specifically state what the sort order is.

I assume you are doing this through enterprise manager. If my assumption is wrong, then let me know.

Right click on a table -> Open Table -> Return All Rows
At this point, you will see your data.

Right click on the data -> Show Panes -> SQL
At this point, the window will divide vertically. At the top you will see something like, Select * From TableName. Modify this to... Select * From TableName Order By [ColumnName]

Most likely you will need to do this every time you open the table.


-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top