Good day.
I do to SQL Server the function returning the table. In addition to the other parameters, I pass to the function the field by which you want to sort and the direction of the sort :
/* к примеру @sidx = 'name'; @sord = 'ASC'; */ ... тело запроса ... ORDER BY @sidx @sord
I get "Incorrect syntax near '@sord'". What is actually a mistake?
@sidx
and@sord
. - Anton Mukhin