惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - 林石

[转].NET Core、Xamarin、.NET Standard和.NET Framework四者之间的区别 .NET工行E生活接入AES加密算法的吐槽-2018 [转]MYSQL性能查看(命中率,慢查询) 可遇不可求的Question之MySql4.0前版本不支持union与批量SQL提交 Cookie的几点忠告 可遇不可求的Question之MySqlClient的Guid 类型的映射篇 可遇不可求的Question之Sqlserver2005文件组的迁移篇 可遇不可求的Question之INSERT … ON DUPLICATE KEY UPDATE 语法篇 可遇不可求的Question之Mysql在不重启服务的情况下修改运行时变量篇 可遇不可求的Question之MySQL系统变量interactive_timeout 与 wait_timeout 篇 可遇不可求的Question之flash的socket连接安全策略文件篇 可遇不可求的Question之error: Failed dependencies: MySQLconflicts 错误篇 可遇不可求的Question之导入mysql中文乱码解决方法篇 Codesmith怎么判断sqlserver数据库字段是不是标识自增字段 可遇不可求的Question之skip-name-resolve模式篇 MySQL Error Codes MYSQL的错误代码 [转]如何成为强大的程序员? 可遇不可求的Question之Silverlight完美加密工具deepsea篇 可遇不可求的Question之反序列化时出现“base-64 字符数组的无效长度”错误提示篇
可遇不可求的Question之SQLSERVER触发器不支持多行插入操作篇
林石 · 2017-03-09 · via 博客园 - 林石

描述:

我们经常遇到 insert table_a select * from table_b 这样的语句,

同时在表table_a中根据每一条新增的SQL语句,通过触发器来触发对应的一系列的后续操作.

分析:

实际上insert触发器,在每次SQL语句中只会影响到第一条的语句

如果触发器被启用,触发器对每个批处理执行一次。

触发器是针对一个事务而言,而不是根据数据记录来做触发的。
inserted   deleted是可以当作是临时表,但不是一条记录的临时表,而是批处理的临时表(一个事务的临时表)

理解这个才能做触发器啊,大家看例子太多,其实那些根本是极简单的例子,而没有对其做真正解释。估计很多人就是根据样例用触发器的,那么这些触发器从应用来说就是非常不完整的