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

Parameterized expression in a variable Expand / Collapse
Author
Message
Posted Wednesday, December 31, 2008 1:27 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, February 11, 2011 7:01 AM
Points: 91, Visits: 198
i want to execute a stored which takes a parameter.
i am using a SSIS variable and passing it to the query through a variable expression.

Could you please let me know how do i put a parameter in a query?


Post #627879
Posted Wednesday, December 31, 2008 9:26 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Friday, September 19, 2014 2:29 PM
Points: 1,481, Visits: 1,031
using a parameter in a query using ssis is fairly simple.

For every place you want a parameter use a ? in place of a variable name.

The variables are used in order that you have them in your query.

For example

Select Mycol1, MyCol2
FROM MyTable
Where MyCol3 between ? and ?

This uses 2 parameters.
On your execute sql task select Parameter Mapping.
and add a new Variable for every ? in your query. SSIS Evaluates these by ordinal,
Meaning Parameter 0 is the first ? and Parameter 1 is the second?
On a side note Change the name of the Parameter to be just 0. and 1 Respectively
If I have Confused you
Check this page out.
http://www.sqlis.com/post/The-Execute-SQL-Task.aspx
Post #628151
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse