February 22, 2001 02:22 PM

Parameterizing Result Order

Rating: (0)
SQL Server Magazine
InstantDoc ID #16495
Return a sorted output based on a parameter
Editor's Note: Send your experts-only T-SQL tips to Itzik Ben-Gan at blackbelt@sqlmag.com. If we use your tip in the magazine, you'll receive $100 and an exclusive T-SQL Black Belt shirt.

Parameterizing Result Order
One question that often appears in public newsgroups is "How can you return sorted output based on a parameter that you pass to a stored procedure?" I've gathered a few s...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

It is very helpful for my project

Natalie6/29/2004 6:21:55 PM


How will you handle the case when you are asked to sort by either:
CompanyName, Phone
or
Phone, CompanyName

i.e. sort by more than one columns, can you still use case statement?

Vik Mohindra 11/3/2001 10:43:39 AM


Is there a way to modify this technique to include the sort order without using dynamic SQL?

M. Young 7/10/2001 10:45:04 AM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS