Re: Regarding Order By Clause In Stored Procedure



James Simpson wrote:
Hello again,
It would also then work if I just go ASC, due to the way SELECT is
pulling the data, correct? If it pulls from the bottom and I tell it
to order by ascending on the ID, it will give me the results of the
id going from largest to smallest.

Again, It is a very bad practice to force the query engine to create a
sorted resultset of ALL the rows in your table when you are only interested
in the results from a single row. Yes, your idea would "work", but it would
be an incredibly inefficient use of resources. let the query engine do what
it was designed to do: use a WHERE clause when you wish to retrieve a single
row.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.