gpt4 book ai didi

database - Azure 数据工厂管道复制多个表失败

转载 作者:行者123 更新时间:2023-12-03 04:04:20 24 4
gpt4 key购买 nike

我的第一篇文章,如果我做错了什么,请提前道歉

我已按照下面的 Microsoft 文档中的说明进行操作,并创建了一个数据工厂,以将多个表的数据从本地数据库复制到 Azure 数据库。

here

管道失败并出现以下错误:

PipelineName      : GetTableListAndTriggerCopyData
LastUpdated : 3/20/2020 10:16:42 AM
Parameters : {}
RunStart : 3/20/2020 10:16:10 AM
RunEnd : 3/20/2020 10:16:42 AM
DurationInMs : 32430
Status : Failed
Message : Operation on target TriggerCopy failed:Operation on target IterateSQLTables failed: Activity failed because an inner activity failed

两个管道的 Json 数据如下:

第一个管道 IterateAndCopySQLTables

{
"name": "IterateAndCopySQLTables",
"properties": {
"activities": [
{
"name": "IterateSQLTables",
"type": "ForEach",
"typeProperties": {
"isSequential": "false",
"items": {
"value": "@pipeline().parameters.tableList",
"type": "Expression"
},
"activities": [
{
"name": "CopyData",
"description": "Copy data from On Prem SQL database to Azure SQL database",
"type": "Copy",
"inputs": [
{
"referenceName": "OnPremSourceDataset",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "AzureSinkDataset",
"type": "DatasetReference",
"parameters": {
"SinkTableName": "[@{item().TABLE_NAME}]"
}
}
],
"typeProperties": {
"source": {
"type": "SqlSource",
"sqlReaderQuery": "SELECT * FROM dbo.[@{item().TABLE_NAME}]"
},
"sink": {
"type": "AzureSqlSink",
"preCopyScript": "TRUNCATE TABLE dbo.[@{item().TABLE_NAME}]"
}

}
}
]
}
}
],
"parameters": {
"tableList": {
"type": "Array"
}
}
}
}

第二条管道:GetTableListAndTriggerCopyData

{
"name":"GetTableListAndTriggerCopyData",
"properties":{
"activities":[
{
"name": "LookupTableList",
"description": "Retrieve the table list from On Prem SQL database",
"type": "Lookup",
"typeProperties": {
"source": {
"type": "SqlSource",
"sqlReaderQuery": "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'dbo' and TABLE_NAME in ('Brd','Loc')"
},
"dataset": {
"referenceName": "OnPremSourceDataset",
"type": "DatasetReference"
},
"firstRowOnly": false
}
},
{
"name": "TriggerCopy",
"type": "ExecutePipeline",
"typeProperties": {
"parameters": {
"tableList": {
"value": "@array(activity('LookupTableList').output.value)",
"type": "Expression"
}
},
"pipeline": {
"referenceName": "IterateAndCopySQLTables",
"type": "PipelineReference"
},
"waitOnCompletion": true
},
"dependsOn": [
{
"activity": "LookupTableList",
"dependencyConditions": [
"Succeeded"
]
}
]
}
]
}
}

最佳答案

感谢大家的评论。

问题出在 (GetTableListAndTriggerCopyData)

"value": "@array(activity('LookupTableList').output.value)", 是错误的,正确的语法是:"value": "@activity('LookupTableList').output.value)",

关于database - Azure 数据工厂管道复制多个表失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60772569/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com