Create an SSIS package diagram C # Call SSIS package to import SQL data to an Excel file

Source: Internet
Author: User
Tags ssis

Objective: To explain in detail how to create a SSIS package

I have bought a Pirated Windows 2003 operating system CD, which comes with a very detailed graphic introduction, that is, the system installation diagram of the dumb version. Therefore, this article is intended to be explained in that way. In this way, you will have an overall understanding of how to make your own SSIS package according to the following steps, each process is shown in detail in the following steps:

(1) first, open SQL server business intelligence Studio (SQL Server Business Intelligence Development Platform), which comes with the SQL Server 2005 database ). The open interface is the same as the Visual Studio interface we usually use, as shown in:

 

(2) Click "file"> "new" à "project" to go to the "new project" Page:

 

 

(3) Select "Integration Services Project", enter a name, select a project location, and click OK to go to our main operation interface, as shown below:

 

 

(4) Check the Toolbox on the left.

 

 

(5) drag "Data Flow task" to our "control flow" panel in the toolbox, as shown below:

 

 

(6) Right-click the blank area of "Connection Manager" below, and right-click the menu and select "ADO. Net Connection Manager". The following window is displayed:

 

 

(7) Click "new" to bring up the "Connection Manager" window, as shown below:

 

 

(8) Select the server name. The default server name is. Select a database and click test connection. The connection test succeeded message is displayed.

 

 

(9) Click "OK" and modify the connection object name in "Connection Manager" to "adoconnection ";

 

 

(10) Click "Data Stream", drag a "datareader source" and an "Excel target" Control in the toolbox, and place it in the "Data Stream" panel.

 

 

(11) Right-click the "datareader source" control and select "advanced editing" To Go To The following page. Select "Connection Manager" and set the value to "adoconnection" We just modified ", click OK.

 

 

(12) Click "component properties" and click Edit next to "sqlcommand" in "Custom properties". The edit window is displayed, and the corresponding value (test value) is entered)

 

 

(13) Check "column ing"

 

 

(14) drag the arrow of the "datareader source" control to connect it to the "Excel target" control:

 

 

(15) Right-click the "Excel target" control and choose "edit" from the shortcut menu to go to the Editor interface, as shown below:

 

 

(16) Click "new". The following window is displayed. Select the path of the Excel template (Excel template in the "Excel export" directory of the previous project), and click OK;

 

 

(17) Select "Excel worksheet name" as the default Sheet 1 $, which is the default first table in Excel.

 

 

(18) Check the ing:

 

 

(19th) Click "OK" and change the "Excel Connection Manager" in the Connection Manager to "excelconnection ";

 

 

(20) enter the main interface, click "control flow", right-click the control flow panel, and select the "variable" menu. The "Variable Window" is displayed ". We add a variable named "sqlstr" with the Data Type "string" and the value "exce DBO ....." (Same as the value of Step 12 ). Of course, you can create your own variable name, data type and value here.

 

 

(21) we have created the variable. Right-click "Data Flow task", select "expressions" in the Properties window, and click "..." next to it to enter the expression editing interface:

 

 

(22) as shown below, click "..." to bring up the "expression generator" window:

 

 

(23) Click "User: sqlstr" in the variable and drag it to the "expression" (in the red box marked below)

 

 

(24) Click "computing expression". The following figure is displayed:

 

 

(25) Click "OK" and click "OK". The following result is displayed, indicating that the operation is successful.

 

This article has basically ended. We didn't write any line of code, and the complete interface operation has implemented the SSIS data packet creation process. This is really simple for us. Of course, the intermediate connection names and variables are related to the settings in the Code. Therefore, we need to be very careful.

 

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.