22,210
社区成员
发帖
与我相关
我的任务
分享
ALTER Trigger triStudent
On Student --在Student表中创建触发器
for insert --为什么事件触发
As --事件触发后所要做的事情
begin
--如果新插入的学生没有体重信息,则不改变原来全班平均体重
if (Inserted.weight=0 or Inserted.weight is null)
begin
end
else
begin
end
end
ALTER Trigger triStudent
On Student --在Student表中创建触发器
for insert --为什么事件触发
As --事件触发后所要做的事情
begin
--如果新插入的学生没有体重信息,则不改变原来全班平均体重
if (Inserted.weight=0 or Inserted.weight is null)
begin
end
else
end
end
if weight=0 or weight is null
begin
print '返回'
--返回,就是啥都不执行
end
else
print '执行代码'
if weight=0 or weight is null
begin
--返回,就是啥都不执行
end
else
--执行代码