If I write two SELECT
statements in a IF EXISTS
condition with a AND
clause in between these select queries, does both queries get executed even if the first SELECT
returns false?
IF EXISTS (SELECT....) AND EXISTS(SELECT ....)
BEGIN
END
Does the SQL Server Engine execute both the SQL Statement in this scenario?
Thanks Krish
You can prevent the second scan by doing this: