Kinda sorta.. You can make use of CASE expressions to do a "dynamic" sort. But, not quite to the level of just sorting on the variable itself. For example:ORDER BY
CASE
WHEN @SortColumn = 'CustomerName' AND @SortDir = 'ASC'
THEN CustomerName
END ASC,
CASE
WHEN @SortColumn = 'CustomerName' AND @SortDir = 'DESC'
THEN CustomerName
END DESC,
...