如何创建一个触发器

yibo2010 yibo2010 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
create table ta1
(
taid int identity(1001,1) primary key ,
taName varchar(20) not null,
tasl int
)


create table ta2
(
ta2id int identity(1001,1) primary key ,
ta2Name varchar(20) not null,
ta2ysh int,
ta2sl int
)

要求是当我对ta1的tasl 修改时 触发,首先先比较ta1表中 tasl 是否 大于ta2表中 ta2ysh 如果大于ta2 表的 ta2ysh 则不允许进行修改操作,否则 先修改ta2表中的ta2sl 然后修改 ta1中的tasl。
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
yibo2010
疑难问题 22,298 成员 121,727 内容