使用变量在“复制数据”活动中的SQL源中查询 [英] Use variable for querying in SQL source in Copy Data activity

查看:44
本文介绍了使用变量在“复制数据”活动中的SQL源中查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我想过滤SQL-Source查询中的Run-ID,我用于复制数据活动。到目前为止,我尝试了以下内容:

I would like to filter for the Run-ID within the query of an SQL-Source, that I am using for a Copy Data activity. So far, I tried the following:

选择[...]其中sysRunID = @pipeline()。RunId

select [...] where sysRunID = @pipeline().RunId

。哪个失败了。然后我设置一个名为sysRunID的变量(类型:字符串)并尝试使用其内容:

.. which failed. Then I set a variable (type: string) called sysRunID and tried to use its content:

{" name":" sysRunID" ;,"value":" 82c89684-bcc7-41b7-8032-5105c06c78c7" }

选择[...]其中sysRunID = @variables('sysRunID')。value

select [...] where sysRunID = @variables('sysRunID').value

选择[...其中sysRunID = @activity('Set Variable1')。value

select [...] where sysRunID = @activity('Set Variable1').value

...但它也失败了。错误消息告诉我,我必须声明一个标量变量(我以为我做过)。有人能帮我吗?


...but it also failed. The error message tells me, that I must declare a scalar variable (which I thought I did). Can someone help me?

谢谢!

Rob

推荐答案

您能否详细分享这项要求。

Could you share the requirement in detail.

如果您希望得到数据库中的表中的值,用于过滤数据库中可以在数据库级别本身处理的数据。

In case if you are looking to get the value from a table in the database to filter the data from the database that can be handled in the database level itself.

如果要从ADF传递运行id值(正在进行的作业运行id)我们可能没有任何要初始化的变量,因为您可以直接使用系统变量,它将运行ID附加到您的查询。

If you are looking to pass the run id value from the ADF (On-going job run id) we may not any variable to be initialized as you can directly use the system variable which gives the run id to append to your query.

@pipeline()。 RunId

@pipeline().RunId

谢谢

Naveen Thummalapenta

Naveen Thummalapenta


这篇关于使用变量在“复制数据”活动中的SQL源中查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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