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

Can you run ORDER BY after an insert stmt?

Status
Not open for further replies.

dkillilea

MIS
Dec 7, 2004
41
0
0
US
Is this possible? I have an index on the table, but it's not the way I would typically want to view the table if I SELECT *

I just want the table to be consistent for generic viewing purposes.

Any ideas would be appreciated.

Thank you.
 
ordering of an index is not guaranteed, here is a teaser on this site about that
In order (no pun intended) to order the results in the order that you want to order them by, you need to use order

I mean what is the big deal adding order by..... lazyness?

Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
Google Interview Questions





 
And here is a thread which talks about it thread183-1272512.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Oh and I would almost never use select *. It is a bad practice to select more fields than you actually want to see. Best to get in good habits before you run into performance issues.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top