I have a stored procedure that simply runs a select from a table and orders it. I am passing a variable to this procedure which will determine how this data is ordered. When I use the variable in the order by clause it tells me its not allowed. Does any one know a way of getting round this problem.