I'm having a problem with this if exists statement
It returns an error: Incorrect syntax near keyword ELSE.
I can't see what wrong with it. Both cluses work independantly. It SQL Server express in asp.net 2005
thanks
Code:
IF EXISTS (SELECT scac
FROM accessorials
WHERE (CustScac = 'CTL1') AND (CustNo = '123'))
ELSE
SELECT SCAC
FROM accessorials
WHERE (CustScac = 'CTL1')
It returns an error: Incorrect syntax near keyword ELSE.
I can't see what wrong with it. Both cluses work independantly. It SQL Server express in asp.net 2005
thanks