Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to assign values to the variable in ssis package Expand / Collapse
Author
Message
Posted Monday, August 29, 2011 2:40 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 11:21 PM
Points: 230, Visits: 157
Hi..

i have an ssis package and have created a variable called "Date".

now what i want is... execute a store procedure and the
result of the store procedure value should assign to the
variable "Date" and the Date variable is used in all task of
the packages based on that date the data is been transferred ..

now how to assign the values to the variable after executing the
sp...

Help me...
Post #1166812
Posted Monday, August 29, 2011 7:24 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:41 AM
Points: 2,818, Visits: 2,553
Use an Execute SQL Task for your stored procedure and assign the output to your variable
Post #1166903
Posted Monday, August 29, 2011 2:34 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:07 AM
Points: 11,157, Visits: 12,899
Can you explain what you are doing with the variable? Are you using it as a static start date variable for the package? Are you populating using a function like GETDATE()? If either of those are true there are ways to get that functionality without a round-trip to the database.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1167185
Posted Tuesday, August 30, 2011 1:16 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 11:27 AM
Points: 802, Visits: 1,983
You can populate a date output parameter using the Execute SQL Task by setting the variables in the result set. The first column, Result Name, type 0 (the number zero) and the second select the variable you want to populate from the drop down list.

I'd attach a photo but I'm having some trouble figuring out how that is done.



Post #1167326
Posted Tuesday, August 30, 2011 1:36 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, June 19, 2013 11:21 PM
Points: 230, Visits: 157
Thank you for the responses ..
it really helped me ...
Post #1167331
Posted Tuesday, August 30, 2011 4:35 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 8:24 AM
Points: 194, Visits: 1,087
One simple way is Mark IsStoredProcedure flag to '1'

Execute the stored procedure same as you do in Query Analyzer in Sql Server 2008
Post #1167385
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse