1

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)", "@QuarterID", and all different syntax. Is there anyone out there who could help me on this one?

1 Answer 1

2

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 =?
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.