> I am getting an error Incorrect syntax near the keyword else. This SP
> worked fine until I introduced the second SELECT statement (SELECT
> FirstName, LastName, ect...)
Since you have two statements after the IF, only the first is being
associated with the IF condition. The ELSE is seen as without a
matching IF.
A BEGIN...END block will group the two IF condition statements so that
they will be executed together. If the IF condition fails, the ELSE
condition will execute:
IF @Users_id = 0
BEGIN
INSERT statement...
SELECT statement...
END
ELSE
UPDATE statement...
Hope this helps,
Phillip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies
around the world in government. Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us
Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:3004
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6