--推荐使用instead of 触发器,没有必要先插入再删除,浪费系统资源
create trigger actname_insert on 工作情况表
instead of insert
as
begin
declare @count int
select @count=Count(*) from inserted where 活动名称=null
insert into 工作情况表 select * from inserted where 活动名称<>null
if @count>0
raiserror('必须输入活动名称!',16,1)
end
本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。