简体   繁体   English

使用Logic Apps和Azure SQL的SQL事务

[英]SQL Transactions with Logic Apps and Azure SQL

有没有办法在使用Azure Logic Apps和Microsoft SQL Connector影响单个Azure SQL数据库和多个表时实现SQL事务?

While it is not possible to include a SQL Transaction in Logic App flow, presumable to cover multiple Actions, you can still do transactional operations on SQL Server. 虽然不可能在逻辑应用程序流程中包含SQL事务,可以涵盖多个操作,但您仍然可以在SQL Server上执行事务操作。

The way to do this is with a Stored Procedure which can implement any level of transactionality you need. 这样做的方法是使用存储过程,它可以实现您需要的任何级别的事务性。

One very simple approach would be to load the data into staging tables first, then call a Stored Procedure to transactionally insert the data into the primary tables. 一种非常简单的方法是首先将数据加载到临时表中,然后调用存储过程以事务方式将数据插入主表。 Another option is to use OPENJSON to effectively mimic the Composite Operation feature of the BizTalk SQL Adapter, also in a Stored Procedure. 另一种选择是使用OPENJSON有效地模仿BizTalk SQL适配器的复合操作功能,也在存储过程中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM