我在 SSIS 包中有 3 个变量,如下所示
NAME TYPE VALUE
FROMDATE String '5/1/2011'
TODATE String Select (FunctionPreviousBusinessDay(),112)
OUTPUT String Select companyName , price from Mytable where date in between '+ @[User::FROMDATE] + "and" + @[User::TODate]'
OUTPUT 给了我评估的表达式,例如:
Select companyName , price from Mytable where date in between '5/1/2011' and
Select (FunctionPreviousBusinessDay(),112)
而不是执行变量TODATE
直接给出字符串。
我期待如下输出
Select companyName , price from Mytable where date in between '5/1/2011' and
'5/22/2011'
我怎样才能做到这一点 ?请指教 ?
直接粘贴sql查询?
但出现以下错误:
Error at Data Flow Task [OLE DB Source [1]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Syntax error, permission violation, or other nonspecific error".