Hi,
I am trying to print out a statement if a record is not found, but I
keep getting Error 156: incorrect syntax near Else. Here is the stored
procedure:
CREATE PROCEDURE AddUpdateDoorSt yles
(
@myprojectid varchar(255),
@doorstyle varchar(255)
)
AS
IF EXISTS (select *
from myproject_doors tyles
where myproject_id = @myprojectid and door_style = @doorstyle)
ELSE
Print 'test'
GO
Any ideas?
Thanks,
Chris
I am trying to print out a statement if a record is not found, but I
keep getting Error 156: incorrect syntax near Else. Here is the stored
procedure:
CREATE PROCEDURE AddUpdateDoorSt yles
(
@myprojectid varchar(255),
@doorstyle varchar(255)
)
AS
IF EXISTS (select *
from myproject_doors tyles
where myproject_id = @myprojectid and door_style = @doorstyle)
ELSE
Print 'test'
GO
Any ideas?
Thanks,
Chris
Comment