[英]How to delete records from a sql database using azure data factory
I am setting up a pipeline in data factory where the first part of the pipeline needs some pre-processing cleaning.我正在数据工厂中设置管道,其中管道的第一部分需要一些预处理清理。 I currently have a script set up to query these rows that need to be deleted, and export these results into a csv.
我目前设置了一个脚本来查询这些需要删除的行,并将这些结果导出到一个 csv 中。
What I am looking for is essentially the opposite of an upsert copy activity.我正在寻找的基本上与更新插入复制活动相反。 I would like the procedure to delete the rows in my table based on a matching row.
我希望程序根据匹配的行删除表中的行。
Apologies in advanced if this is an easy solution, I am fairly new to data factory and just need help looking in the right direction.如果这是一个简单的解决方案,请提前致歉,我对数据工厂还很陌生,只需要帮助寻找正确的方向。
Assuming the source from which you are initially getting the rows is different from the sink There are multiple ways to achieve it.假设您最初从中获取行的来源与接收器不同有多种方法可以实现它。
in case if the number of rows is less, we can leverage script activity or lookup activity to delete the records from the destination table如果行数较少,我们可以利用脚本活动或查找活动从目标表中删除记录
in case of larger dataset, limitations of lookup activity, you can copy the data into a staging table with in destination and leverage a script activity to delete the matching rows如果数据集较大,查找活动受到限制,您可以将数据复制到目标中的暂存表中,并利用脚本活动删除匹配的行
in case if your org supports usage of dataflows, you can use that to achieve it如果您的组织支持使用数据流,您可以使用它来实现它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.