How to Pass Parameter in Ado.Net Source Ssis

Use Variable in SQL Command SSIS of ADO net source

Yes, you can do it, using expression.
Open data flow task, right-click on empty space there and choose "Properties".
Sample Image

In "Properties" window choose "Expressions"
Sample Image

In opened window choose [Your data source].[SqlCommand] and add you variable there in Expression input.
Sample Image

SSIS - Passing Parameters to an ADO .NET Source query

From your description it seems like you are having an error due to using the variable name inside the query string as opposed to the processed variable value. In other words:

"SELECT * FROM @[User::TABLE]" in the expression builder would be WRONG

"SELECT * FROM " + @[User::TABLE] would be CORRECT

It would help if you shared the expression you are using as a query

SSIS Query Parameters for ADO .NET Source

Set Data Access Mode in ADO.NET Source to SQL Command and write the query.

Using Dynamic Table name in ADO.NET Source Editor

Expression must be set on the Data Flow Task not in the Ado.net Source

Follow this steps to set an expression for an Ado.net Source:

  1. in the control flow tab click on the Data Flow Task and press F4 to show the properties tab
  2. Click on the expression button, it show up a form like shown below

Sample Image


  1. choose [Ado.net Source].sqlcommand property and click on the expression builder button

Sample Image


  1. write the following expression "select * from Sample_ " + @[User::DateParameter] + "_Data" (assuming that your data parameter is stored in a variable named DateParameter)

Sample Image



Related Topics



Leave a reply



Submit