【发布时间】:2019-07-03 14:00:49
【问题描述】:
我正在尝试使用 Azure 数据工厂从源表中将上次运行时的数据加载到 lastmodifieddate。
这工作正常:
@concat(' SELECT * FROM dbo. ',
item().TABLE_list ,
' WHERE modifieddate > DATEADD(day, -1, GETDATE())')"
当我使用时:
@concat(' SELECT * FROM dbo. ',
item().TABLE_list ,
' WHERE modifieddate > @{formatDateTime(
addhours(pipeline().TriggerTime-24)),
''yyyy','-','MM','-','ddTHH',':','mm',':','ssZ''}')
得到错误为 ""errorCode": "2200",
"message": "Failure happened on 'Source' side. 'Type=System.Data.SqlClient.SqlException,Message=Must declare the scalar variable \"@\".,Source=.Net SqlClient Data Provider,SqlErrorNumber=137,Class=15,ErrorCode=-2146232060,State=2,Errors=[{Class=15,Number=137,State=2,Message=Must declare the scalar variable \"@\".,},],'",
"failureType": "UserError",
"target": "Copy Data1"
}
我犯了什么错误?
我需要在 where 条件下动态传递管道的最后运行时间日期。
【问题讨论】: