一个触发器

ALTER Trigger [trig_ensure_injury]
on [dbo].[Employee_basic_infomation]
After insert
as
Declare @Injury_status nvarchar(50)
Select @injury_status=injury_status from inserted
if @injury_status is null
Begin
  update dbo.Employee_basic_infomation
  Set injury_status='未保'
  From Employee_basic_infomation e inner join Inserted i
  On e.sequence=i.sequence
 
End

你可能感兴趣的:(触发器)