存储过程中判断插入是否成功
INSERT INTO
Access_leave VALUES('@leave_type','@leave_site','@leave_department','@leave_article','@leave_personnel','@leave_credentials','@leave_content','@leave_date','@leave_img','@leave_card','@leave_PO','@Access_join_PO') 这里怎么判断是否插入成功,插入成功后在执行下面的语句
if exists(select * from Access_leave where Access_leave_PO=@leave_PO)
begin
insert into State values('@join_Name','@join_personnel','@join_site','在厂','@join_card')
set @rtn_join=0 --插入成功
end
else
begin
set @rtn_join=1 --插入失败
end