Groups | Blog | Home
all groups > sql server programming > november 2003 >

sql server programming : syntax error



TJS
11/5/2003 11:16:50 PM
using a IF statement in stored procedure but won't save.
what is causing 'incorrect syntax error near keyword "else" ' ?


IF <condition>
EXEC mysp1
ExEC mysp2 --error here
ELSE
blah blah blah...
GO

Tibor Karaszi
11/6/2003 7:21:22 AM
You need a statement grouping command:

IF <condition>
BEGIN
EXEC mysp1
ExEC mysp2 --error here
END
ELSE
BEGIN
blah blah blah...
END
GO

--
Tibor Karaszi


[quoted text, click to view]

AddThis Social Bookmark Button