In this third in a series on working smarter with T-SQL, let's give the built-in sp_executesql stored proc a go. In my previous posts, I've described some methods for generating and executing T-SQL ...
Can I put a parameter in the ORDER BY of a stored procedure?<P>If I do this:<BR><b>ORDER BY @myParam</b><P>I get an error, but if I put:<BR><b>ORDER BY '@myParam'</b><P>No error, but the ORDER BY does ...