Lynn Pettis (6/12/2013)
This arbitrary 3rd column is only for the final sort or does it also impact the select of the rows?Is this query contained in a stored procedure?
Unfortunately no.....it forms part of the index.
This is all in a stored proc which has to be dynamically generated (for a variety of reasons). The user selected sort column name is passed in as a parameter, along with a number of other parameters.