Home  >  Article  >  Database  >  PB+MSSQL+触发器必须注意

PB+MSSQL+触发器必须注意

WBOY
WBOYOriginal
2016-06-07 16:06:261290browse

PB+MS SQL+触发器必须注意: 若触发器存在两笔以上的返回值,比如两条update 语句,被误判为数据有改变,存盘不成功。 提示: Row changed between retrieve and update. No changes made to database. 所以MS SQL 触发器必须统一处理为: 触发器开始加: if

PB+MS SQL+触发器必须注意:

若触发器存在两笔以上的返回值,比如两条update 语句,被误判为数据有改变,存盘不成功。

提示:

Row changed between retrieve and update.

No changes made to database.

所以MS SQL 触发器必须统一处理为:

触发器开始加:

if@@ROWCOUNT=0 Return --提高效能

setnocount on --不返回统计笔数,可减少网络频繁响应,提高效性能;避免误判为数据有改变(sybase不存在此类问题)

结束加:

setnocount off

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Hibernte配置以及junit测试笔记Next article:C#小结