Bonjour
J'ai un problème avec une procédure stockée sur sql server 2016 qui sur update m'affiche une erreur de syntaxe.
Voila mon code, je ne sais pas si le reste est juste mais l'erreur de syntaxe sur l'update me laisse bloqué
merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 create proc for_dispo @rep int ,@select_for char(25), @annee int as begin declare @for table (formation_dispo char(25)) declare @t char(25) declare @emp_for table (id_empp char(25)) insert @for select desision_fcb from FCB where desision_fcb in (select nom_theme from theme) if exists (select formation_dispo from @for where formation_dispo= @select_for ) and (@rep=1) set @t= (select id_theme from theme where nom_theme=@select_for) insert formation (id_theme) values (@t) insert @emp_for select id_emp from employer e inner join FCB_employer fe on e.id_emp=fe.id_emp inner join FCB f on fe.id_fcb=f.id_fcb where desision_fcb=@select_for and datepart(y,date_validation_fcb)=@annee insert session_emp (id_emp) values((select id_empp from @emp_for) update session_emp set id_for=(select id_for from formation where id_theme=@t ) where exists (select id_empp from @emp_for where id_empp in (select id_emp from session_emp)) end
Partager