This same question has been asked within .server
The subject of the post is Re: MS-SQL Server, INTERNALS, IF
clause, -=addition=-
and it is dated 10/27/20001:59pm
I posted this message in that location.
I have also posted it here.
Oz, in the future, please do not post the same question independently to
multiple newsgroups!
Umachandar, Doesn't this example show that SQL Server can short-circuit
expressions?
from my post within .server:
This example should show that SQL Server can short circuit expressions
--This works correctly
print 'test 1'
--This 'short circuits'
print 'test 2'
--This fails
print 'test 3'
--
Keith
==============
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.
Quote:> Short-circuiting an expression is not available in T-SQL. The
optimizer
> can process it any way it wants.
> --
> Umachandar Jayachandran
> SQL Resources at http://www.umachandar.com/resources.htm
> ( Please reply only to newsgroup. )