对多个记录的触发器的启用不适用于linq到sql [英] Inseted of triggers for multiple records is not working with linq to sql

查看:64
本文介绍了对多个记录的触发器的启用不适用于linq到sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我添加了触发更新和插入的内容,



然后使用linq to sql使用csv whn我尝试逐个插入多个记录它不起作用,当我用于单个记录时它如何工作

解决方案

这听起来像你操作仅在触发器中的第一个记录上。



每个语句只触发一次触发器,因此您可能会遇到在同一执行中发生多次更新的情况触发。



因此你需要使用特殊的插入删除表来调查和处理所有修改过的行。



有关更多信息,请参阅使用插入和删除的表 [ ^

Hi ,

I have added insted of trigger for update and insert ,

then using linq to sql using csv whn i try to insert multiple records one by one it doesnt work , howver when i use for single record it works

解决方案

This sounds like you operate on the first record only in the trigger.

The trigger is fired only once per statement so you may have a situation where several updates are occurring inside the same execution of the trigger.

Because of this you need to use special inserted and deleted tables inside your trigger to investigate and handle all of the modified rows .

For more information refer to
Use the inserted and deleted Tables[^]


这篇关于对多个记录的触发器的启用不适用于linq到sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆