azure - 如何将脚本事件输出以 csv/结构化格式推送为接收器

标签 azure azure-data-factory

如果我运行脚本事件,它将给出 json 格式的输出,如何将 csv/任何其他格式的数据推送到 blob/数据库???

考虑一下我从脚本事件(单个查询)输出了 100 万行??

最佳答案

我们可以获取脚本 actvity 的 json 输出并将其复制到 SQL 数据库。下面是方法。

  • 在脚本事件中,查询是在脚本设置中给出的。 从sampletb中选择*

enter image description here

**脚本事件的输出:**

enter image description here

  • 然后此事件的输出存储在字符串类型的变量中。 @string(activity('Script1').output.resultSets[0].rows)

enter image description here

  • 在 SQL 数据库中,创建名为 test_tgt 的目标表。

  • 执行另一个脚本事件并编写以下脚本以复制到 SQL 数据库。

declare @json nvarchar(4000)=N'@{variables('v1')}';
INSERT INTO test_tgt
SELECT * FROM OPENJSON(@json)
WITH (
Col varchar(60) ,
col1 varchar(50)
);

enter image description here

关于azure - 如何将脚本事件输出以 csv/结构化格式推送为接收器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74440860/

相关文章:

StorageTable 中的 Azure PolyBase 外部表

azure - 在 Azure 数据工厂中解压缩 .Z 文件

azure - 使用 Terraform 获取与 Azure 应用程序注册相关的错误

azure-devops - 无法为 Azure Data Factory V2 设置 Azure Devops 的代码存储库

azure - ADF 限制 : Number of COPY Data Activities in One Pipeline?

azure - 当Dynamics CRM用作接收器时如何在azure数据工厂中实现动态列映射

python - 如何使用 Python 触发 Azure Runbook

node.js - 如何使用部署到 Azure 的应用程序修复 "Error: Cannot find module '/home/site/wwwroot/index.js”?

azure - 有没有办法在 Azure 数据工厂中进行简单的字符串操作?

Azure:编排文件传输 - 哪些 Azure 组件最适合?