I have assigned a variable
in SSIS as BatchID
which is Max(ID)
from a table. I have passed the BatchID
through Result Set
in Execute SQL Tas
k (SSIS).Now I can pass that BatchID
variable through out the package. My question is how can I change that object datatype to integer or string so I can use differently?
Asked
Active
Viewed 1,114 times
0

Maverick
- 1,167
- 1
- 8
- 16
1 Answers
-1
Yes you can save the result directly to a integer variable: see some more info here:
How do I capture the single row value from Execute SQL Task that uses an expression?
http://technet.microsoft.com/en-us/library/62605b63-d43b-49e8-a863-e154011e6109
Here are some steps for an OLE DB conneciton:
- Ensure you have created an SSIS variable of type
Int32
orInt64
- In your Execute SQL Task, on the General tab, set the
ResultSet
property toSingle row
- On the
Result Set
tab, Add a record withResult Name
set to 0, and Variable Name = your integer variable
When you run the step it will populate your variable.
NOTE 1: If you run interactively in BIDS, the variable value doesn't stick. i.e. when you go back into design mode, your variable value goes back to whatever you set it to. But it does work during execution time
NOTE 2: You need to put different values in these fields if using the ADO driver.