本文介绍了在Azure Data Factory中使用sqlWriterCleanupScript截断目标表的正确语法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用azure数据工厂来运行ETL.

I am using azure data factory to run an ETL. 

在将数据复制到暂存表之前,我要截断它们.

Before I copy the data across across to the staging tables I want to truncate them. 

我在复制数据向导的接收器部分中输入了以下代码,但是每次尝试运行它时,都会收到错误的语法消息.

I entered the below code in the sink section in the copy data wizard but I get an incorrect syntax message every time I try run it.

此外,我该如何为需要截断的多个表编写代码?

Also, How would I write the code for multiple tables needing truncating ? 

接收器":{
               b " type":"SqlDWSink",
       "writeBatchSize":0,
               b " writeBatchTimeout":"00:00:00",
"sqlWriterCleanupScript":截断table stage.PostGL",
                    }

"sink": {
                        "type": "SqlDWSink",
        "writeBatchSize": 0,
                        "writeBatchTimeout": "00:00:00",
"sqlWriterCleanupScript": "truncate table stage.PostGL",
                    }

AReeves

推荐答案

您可能会因为此处的逗号而收到语法错误:

"sqlWriterCleanupScript":截断表stage.PostGL"

You are probably getting a syntax error because of the comma here :

"sqlWriterCleanupScript": "truncate table stage.PostGL",

尝试一下:

"sink"":{
       ;                                        " type" ;:" SqlDWSink",
       ;   "writeBatchSize":0,
       ;                                        "writeBatchTimeout":"00:00:00",
"sqlWriterCleanupScript":截断表stage.PostGL"
       ;                            }

Try this out :

"sink": {
                        "type": "SqlDWSink",
        "writeBatchSize": 0,
                        "writeBatchTimeout": "00:00:00",
"sqlWriterCleanupScript": "truncate table stage.PostGL"
                    }

有关更多信息,您可以查看此链接:

https://docs.microsoft.com/zh-cn/azure/data-factory/v1/data-factory-azure-sql-connector#repeatability-during-copy

另外,您也可以使用存储过程. MSDN上也有类似的帖子:

https://social.msdn.microsoft.com/Forums/azure/zh-CN/66ffadf1-1841-44bf-aa45-8ad38e2a798b/data-factory-truncate-table?forum=AzureDataFactory

让我们知道这是否有帮助,否则我们可以继续进行对话.

For more information, you can check this link out :

https://docs.microsoft.com/en-us/azure/data-factory/v1/data-factory-azure-sql-connector#repeatability-during-copy

Also as an alternative, you can use a stored procedure. There's a similar post on MSDN about this :

https://social.msdn.microsoft.com/Forums/azure/en-US/66ffadf1-1841-44bf-aa45-8ad38e2a798b/data-factory-truncate-table?forum=AzureDataFactory

Let us know if this helps or we can gladly continue the dialogue.

-Chirag


这篇关于在Azure Data Factory中使用sqlWriterCleanupScript截断目标表的正确语法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 00:16