你如果要“print”,就不要使用触发器。触发器是后台系统“静静地”干的工作,不想存储过程那样非要输出什么值。CREATE TRIGGER  离职员工  ON [dbo].[员工当值安排表] FOR INSERT, UPDATE AS
declare @retcode int
if  exists (select * From 离职人员记录表 as a 
  inner join inserted as i on a.id=i.id)
  begin
  raiserror('no this employee',16,1)
  rollback transaction
  return
  end
go