SR0007 : Microsoft.Rules.Data : Nullable columns can cause final results to be evaluated as NULL for the predicate

Viewed 328

There's a query in my sp like:

DELETE
    FROM MySchema.TableA
    WHERE Attr1 = @Var1 AND Attr2 = @Var2

But when building it using vs2019, an error raises:

Error:  : SR0007 : Microsoft.Rules.Data : Nullable columns can cause final results to be evaluated as NULL for the predicate.

I tried to change the query to(it fixes the same error of other queries):

DELETE
    FROM MySchema.TableA
    WHERE Attr1 = ISNULL(@Var1, '') AND Attr2 = ISNULL(@Var2, '')

However, it doesn't work. My question is, how do I remove this error? Thank you!

0 Answers
Related