Order of Execution | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Order of Execution

Select Columns from table where col1=’value1′ and col2=’value2′ and col3=’value’
In the above select statement, if col1=’value1′ is false then there is no need of checking for the other conditions
Will SQL Server skip further condition if one condition become false or check for all regardless of the result of condition?
Madhivanan Failing to plan is Planning to fail
A SARG limits a search because it specifies an exact match, a range of values, or a conjunction of two or more items joined by AND. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Since this is in a WHERE clause, evaluation will be stopped, because that row would be invalid in the resultset. It’s a bit different from other comparisons. Check this:http://support.microsoft.com/default.aspx?scid=kb;en-us;898115
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)

Well. Thanks for the clarification.
I hope this applies to nested case and OR clauses also
Madhivanan Failing to plan is Planning to fail
]]>