Menu Close

None Value in Multiselect Parameter

If you have a multiselect parameter but you would like to have the “None” option added to it here is how you can accomplish it. The None option assumes that you would like to display entities (records) that might not have values:

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
, ‘_None’ as Name

Main Dataset Query:

SELECT *
FROM yourTable
WHERE ISNULL(ID, ‘00000000-0000-0000-0000-000000000000’) IN (@yourParameter)