using CASE with multiple OrderBy and optional ASC/DESC

I am writing a stored procedure in SQL that will sort by two criteria\[code\]ORDER BY CASE @SortBy1 WHEN NULL THEN '' WHEN .... THEN .... etc END, CASE @SortBy2 WHEN NULL THEN '' WHEN .... THEN .... etc END\[/code\]this works fine but then I want to also add another parameter to do \[code\]ASC/DESC\[/code\]. I tried different ways but it gives me a wrong syntax error.I saw this answer but I have so many columns, is there an easier way??
 
Top