我的第一篇文章,如果我做错了事,对不起!
我已按照下面的Microsoft文档中的说明进行操作,并创建了一个数据工厂,以将多个表的数据从本地数据库复制到Azure数据库。
管道失败,出现以下错误:
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"
]
}
]
}
]
}
}
答案 0 :(得分:0)
非常感谢您的评论。
问题出在(GetTableListAndTriggerCopyData)
“ value”:“ @array(activity('LookupTableList')。output.value)”, 是错误的,正确的语法是: “ value”:“ @activity('LookupTableList')。output.value)”,