Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question came up in a discussion at work... given the following T-SQL statement:

select firstname, lastname from users order by lastname;

the default sort order on the order by clause is asc.

Is there a setting within SQL Server that will allow you to change the default order used when the ASC|DESC modifiers are not specified?

share|improve this question
up vote 7 down vote accepted

No, the default sort order is always ASC.

share|improve this answer
which is required by the SQL standard if I'm not mistaken (but that wouldn't bother Microsoft on the other hand...) – a_horse_with_no_name Feb 14 '13 at 22:02
@a_horse_with_no_name I think 5-10 years ago that would have been a fair statement, but they've been much better in recent versions at actually paying attention to the standards. They've at least stopped violating them, and I welcome extensions they add over and above what the standard defines. – Aaron Bertrand Feb 14 '13 at 22:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.