我已經在包級別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查詢的結果? –