I want to code an SP that will have a parameter which allows the user to determine the column the data is sorted by. I tried passing a varchar parameter and using this statement
Order by @SortOrder
and I get error 1008.
"The select item identified by the order by Number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by and expression referencing a cloumn name.
Any help on this would be greatly appreciated.
Order by @SortOrder
and I get error 1008.
"The select item identified by the order by Number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by and expression referencing a cloumn name.
Any help on this would be greatly appreciated.