asked on
select 'c'
where
1/0 = 2 and 'a' = 'b'
----
(0 row(s) affected)
select 1 where
CEILING(1.22) = 2 and 1/0 = 2
-----------
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
In this case SQL Server chose to validate the second condition first.
select textvalue from aTable WHERE ISNUMERIC(textvalue) = 1 and convert(int, textvalue) = 1
There is of course a workaround to use a CASE statement which I actually use from time to time
ASKER
Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.
TRUSTED BY
ASKER
(conditionA and conditionB)
or conditionC
or (condition D and condition E)