I am trying to compare a table value to a variable which can be null, however since we cannot equate this to null hence this is not comparable.
declare @test varchar(33) -- This can or cannot be NULL;
select * from [dbo].[ViewsConfiguration] where PolicyId= 139 and EventName= @test
This can be done using switch or if , however looking for a more elegant way to do this.
ISNULL/ COALESCElike thisand ISNULL(EventName,'')= ISNULL(@test,'')