SSIS Passing Parameters to an ADO .NET Source query; pass parameters to the ado.net data source.

The parameter buttons when using SSIS's oledb data source are as follows:


But when using ADO.NET source to connect to MYSQL, without this parameter button, how to pass parameters to the sql command of the data stream?


steps:

1. On the Control Flow tab, right-click on the data flow task containing the ado.net source and select Properties-> Set Expressions.


2. Set as follows in the property expression editor:


Properties: Select ADO.NET source.SQLCommand. Note that the ADO.NET source is the name of the ado.net source. If you have changed the component name, this is your custom name. sqlcommand.

Expression: Click the button at the back, fill in your sql statement and the value passed from the variable and parameter, which is @ [User :: PV_WaterMarkValue] in this example, and then click the calculation expression Button:

Note: The method of string concatenation is used, pay attention to "" and "'.

My example here is:

"select    cast(date_format(orderdate,'%Y%m%d') as signed) as datekey,`order`.*, branchoffice.BranchOfficeName  from `order` inner join branchoffice on `order`.BranchOfficeSN=branchoffice.BranchOfficeSN where `order`.orderdate >'"+  @[User::PV_WaterMarkValue]+"'"


In this way, the ado.net source in the Data flow task gets the value returned from Get Water Mark.

 

By the way, demonstrate how the value in Get Water Mark is returned:

1. Define variables


2. Assign values ​​to variables


3. Set the result set







Intelligent Recommendation

Passing parameters: pass by value, pass by reference

If the parameter passed is an immutable type, the outside of the function is unchanged, if the parameter passed is a variable type, then the outside of the function is variable. Pass by value: will no...

Java pass parameters - the difference between the basic data type and the reference data type as parameters (value passing)

Methods in java can pass parameters, and the method of passing parameters is value passing. The parameters have formal parameters and actual parameters. The parameters written when defining the method...

MyBatis query passing the MAP parameters

scenes to be used Mybaits passes the MAP query data, and the judgment in Choose uses itself according to its own Map parameter type. The value of the pass is the object type. The point you need here i...

FastAPI source code analysis-Path Query parameters

FastAPI source code analysis-Path Query parameters In the REST interface, parameters are received in three ways: Path, Query, Header/Body Path:http://pandora128.cn/{param} Query: http://pandora128.cn?...

[Angular4 learning]-routing parameter one (passing data in query parameters)

Preface What is the point of passing parameters during routing? For a simple example, we enter a certain treasure or a certain east, click on a certain product, and then specify to jump to the corresp...

More Recommendation

C # /. NET Winform binding data source changes the data interface parameters are changed

C # /. NET Winform binding data source changes the data interface parameters are changed 1, add a referenceusing System.ComponentModel; 2, the data source entity class inherits from Model:INotifyPrope...

Jasperreports+jaspersoft studio learning tutorial (2) - use the Parameters property to pass in the Map data source to fill the report

2.1 Designing a report template 2.1.1 Create a new report template (DemoReport2) in Studio, delete the unwanted Band, Column Header, ColumnFooter, Summary, Background, inoutlineinterfaceIn the middle ...

Jaspersoft report: fill in the report based on the Parameters property and pass in the Map data source

Step 1: Design a report template Create a new report template (report2) in Jaspersoft Studio, remove the unnecessary Band (paragraph), select Column Header, ColumnFooter, Summary in the outline interf...

Passing parameters in Python: in the end is pass by value or reference

Reference blog:http://winterttr.me/2015/10/24/python-passing-arguments-as-value-or-reference/ We began to explain the following: First: Python kind of file is kind of how variable assignment? ? ? &quo...

MYBATIS passing 4 ways to pass multiple parameters

MYBATIS passing 4 ways to pass multiple parameters 1.map interface delivery parameters 2. Use annotations to transfer multiple parameters 3. Pass by JavaBean 4. Mixing Summarize 1.map interface delive...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top