Menu Close

Select All in a Single Select Parameter

If you have a single select parameter but you would like to have the “Select All” option added to it here is how you can accomplish it:

We will assume that ID is of type uniqueidentifier.

Parameter Query:


SELECT
ID
, Name
FROM table

UNION

SELECT
'00000000-0000-0000-0000-000000000000' AS ID
, 'Select All' as Name

Main Dataset Query:


SELECT *
FROM yourTable
WHERE ID = @yourParameter
OR @yourParameter = '00000000-0000-0000-0000-000000000000'