Hi,
How to handle NULL and with Value (comma Separated) Parameters in where condition in SP
Based on this ulr https://blog.sqlauthority.com/2017/06/18/write-case-statement-clause-interview-question-week-127/
I wrote
SubRegionCode=
CASE WHEN (@SubRegionCode IS NOT NULL AND @SubRegionCode!='') THEN @SubRegionCode
ELSE SubRegionCode
END
And based on this article
(SubRegionCode=@SubRegionCodeor ISNULL(@SubRegionCode,'')='')
Both are working if I have values like @SubRegionCode=N'EURA' and @SubRegionCode=N'', but result is coming as 0 (not working) if I have values as @SubRegionCode=N'EURA,US'.
That is if we pass 2 values from FE, its not working.