The way I would handle this would be by passing the parameters as parameters to the query in the data set. So the query would look something like this:
IF @OrderParameter = 'TOP'
BEGIN;
SELECT TOP (@TopParameter)
*
FROM
sys.all_columns AS AC
ORDER BY
AC.name DESC;
END;
ELSE
BEGIN;
SELECT TOP (@TopParameter)
*
FROM
sys.all_columns AS AC
ORDER BY
AC.name;
END
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question