I'm trying to create a stored procedure into which I'd like to pass the column name and direction by which to sort the result. For example I'd like to pass "fldNAME DESC" as the @ORDER. Is this possible ? Thanks.
Code:
CREATE PROCEDURE sp_MY_POROC
@ID as INT
@ORDER AS Something
AS
SELECT fldNAME FROM tblTABLE WHERE ID = @ID ORDER BY
GO