DTS parameter transfer example

Source: Internet
Author: User

DTS parameter transfer example

-- 1. Create a test table

Create Table tempdb. DBO. Tb (id int)

-- 2. Create a data transmission package

Create in the package:
A. Microsoft ole db provider for SQL Server connection
B. Execute an SQL task
Write the "SQL statement" of the task: insert TB values (?)
Click "parameter" to open the "parameter ing" dialog box.
Click the "Create global variable" button to create a global variable named value, whose type is integer and whose value is 1.
Click "OK" to return to the "parameter ing" dialog box. In the "parameter ing" list, enter the global variable "select" value "for" parameter 1"
Click "OK" to return to the "DTS package definition" window.
C. Save the DTS package. Set the package name to a and the location to "SQL Server"

-- 3. Create a new package to call Package

Create in the package:
A. Run the Package task
Select the package name a created in step 2 from the package name in the general option
In the "external global variables" option, enter the variable name value. (Corresponding to the global variables in step 2)
B. Save the DTS package. Set the package name to B and the location to "SQL Server"

-- 4. Run the package and view the result.

Exec master. DBO. xp_mongoshell 'dtsrun/S/e/N "B"/a "value": 3 = "2 "'
Exec master. DBO. xp_mongoshell 'dtsrun/S/e/N "B"/a "value": 3 = "3 "'
Exec master. DBO. xp_mongoshell 'dtsrun/S/e/N "B"/a "value": 3 = "5 "'
Exec master. DBO. xp_mongoshell 'dtsrun/S/e/N "B"/a "value": 3 = "10 "'
Select * From tempdb. DBO. TB
Drop table tempdb. DBO. TB

Csdn Community post address

Related Article

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.