Dynamic input to t-sql task in SSIS
I have a package that includes a T-SQL step. I have created som variables to use in the t-sql statement. But I don't find the correct syntax for using the variable in my t-sql statement.
My variable is QuarterID. And in my t-sql I want to use this variable.
t-sql: DECLARE @myQuarterId int select @myQuarterId = User::QuarterID
I have tried "@(User::QuarterID)", "@Qua开发者_如何转开发rterID", and all different syntax. Is there anyone out there who could help me on this one?
YOu open the Execute SQL task and got to the parameter mapping tab and add the variables inteh order you want to reference them. Make sure to change the parameter names to numbers starting with 0 for the first variable you use and incrementing by one for each other variable. Then go back to the general tab and write your query
DECLARE @myQuarterId int select @myQuarterId =?
精彩评论