I want like an if then else structure when I use an IF EXISTS CLAUSE. In that case would the code below be correct where I have two BEGIN END statements ?
---------------------------------
IF EXISTS ( SELECT Code from zoop where Code = @newPLAYERId)
BEGIN
update zoop
set Code = '####'
from zoop t
where t.DateEntered > ( select min(x.DateEntered) from zoop x ) -- AND SUBSTRING(t.Code,1,1) = 'A'
END
ELSE
BEGIN
END