我已经在包级别compdate
上声明了一个变量,并且通过在包的控制流中删除Execute SQL Task
来测试数据流。SQL任务 - 设置包变量
在任务,
SQL语句:select ? = (getdate() - 1)
参数映射:
- 变量名:
User::compdate
- 方向:
Output
- 数据类型:
DATE
- 参数名称:
0
- 参数尺寸:
-1
。
为什么我收到错误:
[Execute SQL Task] Error: Executing the query "declare @compdate date
set @compdate = (getdate() ..." failed with the following error: "Syntax error or access violation". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
我很困惑,你的问题到底是什么? –
参考编辑....忘了发布以下问题;) – GoldBishop
您是否试图在您的变量中存储SQL查询的结果? –