0

I have parameter into SSIS:

enter image description here and I try to use that parameter into query like: enter image description here

How do I call my parameter v_sEstatusPresupuesto at final of my query?

I try to use @v_sEstatusPresupuesto but it don´t works. Regards

Gerardo
  • 369
  • 2
  • 6
  • 14
  • Possible duplicate of [How to pass variable as a parameter in Execute SQL Task SSIS?](http://stackoverflow.com/questions/7610491/how-to-pass-variable-as-a-parameter-in-execute-sql-task-ssis) – Tab Alleman May 16 '17 at 13:26

1 Answers1

2

If you are using an ADO.NET Source then you can use an expression on the Data Flow Task for the SQL command of your data source. Something like this:

enter image description here

If you are using an OLE DB Source then put the above expression on a variable and in the data source select SQL command from variable as the Data access mode.

Another method if you are using an OLE DB Source is to select SQL command as the Data access mode and change your query to this:

SELECT 
  ZPRESUPUESTO
  ,DWERK
FROM ZTSD_PRESPZA_WF
WHERE MANDT = 720 
  AND ZVERSION = ?

Then click on the parameters button next to the SQL command text box and assign your parameter.

enter image description here

Dave Sexton
  • 10,768
  • 3
  • 42
  • 56
  • I add it as a variable ut I cant use into ADO .NET Source because I don´t have SQL Command from Variable on Data Access Mode what can I do there? – Gerardo May 16 '17 at 17:00
  • 1
    If it is an ADO.Net source then go with the first option and use an expression. Click on the Data Flow task that holds your Data Source to select it (don't click on the Data Source). Go to properties (Lower right-hand side of Visual Studio). Scroll down until you find Expressions and click the little 3 dot menu to bring up the Expression editor. From the property drop-down select the SQLCommand for your data source. For the expression add the example in my answer. – Dave Sexton May 16 '17 at 17:10