SSIS passing Parameters to an ADO. NET source query, passing parameters to the ADO.

Source: Internet
Author: User
Tags custom name ssis

Parameter buttons when using SSIS OLE DB data sources such as:

But when using the ADO 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, on the Data Flow task that contains the ADO source, right-click Properties, set Expressions.

2. The property expression Editor is set up as follows:

Properties: Select ADO. NET source. SQLCommand, note that the ADO source is the name of the ADO source, and if you change the component name, here is your custom name. SQLCommand.

Expression: Click the button at the back, fill in your SQL statement and the values passed from the variables and parameters, i.e. @[user in this example::P v_watermarkvalue], then click the Calculate Expression button:

Description: Use the string concatenation method, note "and".

My example here is:

"Select CAST (Date_format (OrderDate, '%y%m%d ') as signed) as DateKey, ' order '. *, BranchOffice. Branchofficename from ' order ' inner joins BranchOffice on ' order '. Branchofficesn=branchoffice. BRANCHOFFICESN where ' order '. OrderDate > ' "+ @[user::P v_watermarkvalue]+" ' "

In this way, the ADO source in the Data Flow task gets the value returned from the Get water mark.

By the way, the value in Get water mark is returned:

1. Defining variables

2. Assigning values to variables

3. Set the result set

SSIS passing Parameters to an ADO. NET source query, passing parameters to the ADO.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.