这个情况能写成存储过程吗!

winsock2000 2003-10-09 01:20:56
这个情况能写成存储过程吗!还是写触发器好呢?

table1字段为:
CnNO flags
厂商1 1
厂商2 0

table2字段为:
Toyno Cnno Think
1 厂商1 asfdaf
2 厂商1 fdfd
3 厂商2 434343 //此为新增记录!

当table2新增一条记录,把table1表所对应的记录flags标志改为1
...全文
37 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
CrazyFor 2003-10-09
  • 打赏
  • 举报
回复
可以用触发器,不能用存储过程,
create ti....
for insert
as
update table1 set flage=1 where cnno in(select cnno from inserted)

34,587

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧