>Would there be a way to workaround the usage of NOT in such SQL:
>
>
>SELECT Client.Name
> FROM Client
> WHERE Client.NoProvince=@NoProvince AND NOT (Client.NoStatus=@NoStatus AND Client.ModDate<@ModDate)
>
>
>The execution is getting more complex because the usage of NOT. If I remove the NOT, the execution is straight forward. However, this is only for testing purposes as it wouldn't give the same result.
You can reverse last condition, e.g.
select Name from dbo.Client
where NoProvince = @NoProvince and (NoStatus <> @NoStatus OR ModDate >=@ModDate)
If it's not broken, fix it until it is.
My Blog