将JSON值传递给存储的Proc [英] Passing JSON values to a stored Proc

查看:106
本文介绍了将JSON值传递给存储的Proc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个触发器,它接收一个JSON文件(使用数组分组)。  然后使用存储过程(由逻辑应用程序调用)将JSON文件加载到Azure表中。 我还添加了一个逻辑应用程序活动,如果有
错误(例如主键违规,存储过程正在更新的表中已存在作业),则向我发送电子邮件。

I have set up a trigger which receives a JSON file (which is grouped using an array).  The JSON file is then loaded into an Azure table using a stored proc (called by logic apps).  I have also added a logic apps activity to email me if there is an error (eg primary key violation, job already exists in the table the stored proc is updating).

当在JSON文件中发送单个作业时,逻辑应用程序进程正常工作,但是,当我发送多个作业(例如5个作业)时,存储过程执行5次,每次运行时都尝试添加第一个作业再次到桌面并产生
错误。 数据仍然加载到表中,但Logic App会向我发送电子邮件,说明存在主键违规。

The logic apps process works fine when a single job is sent in the JSON file, however, when I send more than one job, eg 5 jobs, the stored procedure executes 5 times, each time it runs it is trying to add the first job to the table again and produces an error.  The data is loaded into the table still but Logic App triggers the email to me saying that there has been a primary key violation.

有没有办法在JSON数组中发送5个作业单独存储过程? 注意:它们当前位于'for each'循环中,它引用触发器数组名称并将其传递给存储过程。

Is there a way to send the 5 jobs in the JSON array individually to the stored procedure?  Note: They are currently in a 'for each' loop which references the trigger array name and passes it to the stored proc.

希望这是有道理的,任何帮助都会非常感激。

Hopefully this makes sense, any help would be much appreciated.

谢谢。

推荐答案

打开for-each循环的并发设置并设置将值设为1并重试。屏幕截图下方有帮助:

Switch on the concurrency settings of your for-each loop and set the value to 1 and try again. Below screenshot will help:


这篇关于将JSON值传递给存储的Proc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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