Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create trigger blokada_ad_pres
- on employees
- for insert, update
- as
- begin
- declare @job varchar (max)
- select @job = job_id from inserted
- if exists ((select job_id from employees where job_id like 'AD_PRES') and (@job_id = 'AD_PRES'))
- begin
- print 'Istnieje już pracownik o job_id = ADPRES'
- rollback transaction
- end
- else
- begin
- print 'dodano nowego pracownika'
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment