Hi,
When running a select query (on SQL SERVER 2000+) with multiple where statements such as
SELECT *
FROM TABLE1
WHERE TableId = @TableId
AND Column1 = @Column1
AND Column2 = @Column2
AND Column3 = @Column3 etc.
...does the query calculate each and every one of the where clauses even if the first one does not equate? I have a query which checks each of the columns to see if any changes have been made, before updating (i.e. it only updates if there are changes). If the query compares every column then I think I will need to rewrite the query. However, if the query engine first filters to the ID column and then compares each column individually within that filtered set the performance should be fine (I would have thought?).
I hope that makes sense.
Thanks, James.