Link to home
Start Free TrialLog in
Avatar of canuckconsulting
canuckconsultingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How to referrence project parameters in a SSIS Package

I have an SSIS Package I use to import data from two databases having the same table.  In my destination table I have a field DB_ID which indicates which database the row came from.  I was wanting to have this populated from a project parameter I would set at time of import.

Is this the best way to do this and, if so, how can I reference a project parameter from within my data flow task?
Avatar of SThaya
SThaya
Flag of India image

use drived column transformation in your data flow to assign the package parameter values as input to the destination
Hi ,
  One more thing , project parameters do not have an expressions property to define their value.  They are intended to hold a literal value which does not change while the package executes.

so as per your requirement you need to use variables instead of Parameters .My suggestion is get the DB ID from the SQL statement
"select      dbid
            from      master.dbo.sysdatabases
            where      [Name] = @databaseName "

 and then assign to the variable .Then go with the drived column what i mentioned above .


Parameter and variable difference:

http://www.sqlchick.com/entries/2013/9/15/getting-started-with-parameters-variables-configurations-in.html
ASKER CERTIFIED SOLUTION
Avatar of SThaya
SThaya
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of canuckconsulting

ASKER

Superb...thanks!