I have an SP as follows:
CREATE PROCEDURE insertName
IF EXISTS(SELECT fn,ln FROM names WHERE fn=@fname AND ln=@lname)
INSERT INTO names(fn,ln) VALUES(@fname,@lname)
Getting syntax error near 'ELSE'. What is the correct syntax if its not correct.
Thanks to anyone who could help.