Skip to content
Advertisement

Use SQL Field in SSIS Variable

Is it possible to reference a SQL field in your SSIS variable?

For instance, I would like use the field from the “table” below

Select '999999' AS Physician_Profile_ID

as a dynamic variable (named “CMSPhysProID” in our example) here

enter image description here

I plan on concatenating multiple IDs into a In statement.

Advertisement

Answer

Possible by using execute sql task


In left side pan of Execute SQL task, general tab


1.Select result set as single row
2. Connection type ole db
3. Set connection and form SQL statement, As you mentioned Select ‘999999’ AS Physician_Profile_ID
4.Go to result set in your left side pan
5. Add your variable where you want to store ‘999999’
6. Click ok
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement