In Sql Server 2005 when I have multiple parameters do I have the guarantee that the evaluation order will always be from left to right?
Using an exa
The MS SQL Server query optimizer does short circuit, yes. Guaranteed.
Run this:
select 1 where 1 = 0 and 1 / 0 = 10
It will run just fine and not error even though you're dividing by zero because the query optimizer will short-circuit evaluate the where clause. This has implications for any where clause where you're "and"-ing and one of the and parts is a constant.