Integration Services (SSIS) 專案及解決方案Integration Services (SSIS) Projects and Solutions

APPLIES TO: yesSQL Server, including on Linux yesAzure SQL Database yesAzure SQL Data Warehouse noParallel Data Warehouse

SQL ServerSQL Server 提供 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 以用於開發 Integration ServicesIntegration Services 封裝。provides SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) for the development of Integration ServicesIntegration Services packages.

Integration ServicesIntegration Services 套件位在專案中。packages reside in projects. 若要建立及使用 Integration ServicesIntegration Services 專案,您必須安裝 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 環境。To create and work with Integration ServicesIntegration Services projects, you must install the SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) environment. 如需詳細資訊,請參閱安裝 Integration ServicesFor more information, see Install Integration Services.

當您在 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中建立新的 Integration ServicesIntegration Services 專案時,[新增專案] 對話方塊將包含 [Integration Services 專案] 範本。When you create a new Integration ServicesIntegration Services project in SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), the New Project dialog box includes an Integration Services Project template. 此專案範本會建立包含單一封裝的新專案。This project template creates a new project that contains a single package.

專案和方案Projects and solutions

專案會儲存在方案中。Projects are stored in solutions. 您可以先建立方案,然後將 Integration ServicesIntegration Services 專案加入方案。You can create a solution first and then add an Integration ServicesIntegration Services project to the solution. 如果沒有方案存在, SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 會在您第一次建立專案時自動為您建立一個方案。If no solution exists, SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) automatically creates one for you when you first create the project. 方案可以包含多個不同類型的專案。A solution can contain multiple projects of different types.

提示

根據預設,當您在 SQL Server Data ToolsSQL Server Data Tools 中建立新的專案時,方案不會顯示在方案總管 窗格中。By default, when you create a new project in SQL Server Data ToolsSQL Server Data Tools, the solution is not shown in Solution Explorer pane. 若要變更這個預設行為,請按一下 [工具] 功能表上的 [選項] 。To change this default behavior, on the Tools menus, click Options. 在 [選項] 對話方塊中,展開 [專案和方案] ,然後按一下 [一般] 。In the Options dialog box, expand Projects and Solutions, and then click General. 在 [一般] 頁面上,選取 [永遠顯示方案] 。On the General page, select Always show solution.

方案包含專案Solutions contain projects

方案是將您在開發端對端商務方案時所使用的專案分組,並對其進行管理的一個容器。A solution is a container that groups and manages the projects that you use when you develop end-to-end business solutions. 方案可讓您將多個專案當做一個單位來處理,並將對商務方案有幫助的一個或多個相關專案集合在一起。A solution lets you handle multiple projects as one unit and to bring together one or more related projects that contribute to a business solution.

方案可包含不同類型的專案。Solutions can include different types of projects. 若要使用 SSISSSIS 設計師建立 Integration ServicesIntegration Services 封裝,請在 Integration ServicesIntegration Services 所提供的解決方案中利用 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)專案來進行。If you want to use SSISSSIS Designer to create an Integration ServicesIntegration Services package, you work in an Integration ServicesIntegration Services project in a solution provided by SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT).

當您建立新的解決方案時, SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 會將 [解決方案] 資料夾加入方案總管中,並建立副檔名為 .sln 和 .suo 的檔案:When you create a new solution, SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) adds a Solution folder to Solution Explorer, and creates files that have the extensions, .sln and .suo:

  • *.sln 檔案包含方案組態的相關資訊,並列出方案中的專案。The *.sln file contains information about the solution configuration and lists the projects in the solution.

  • *.suo 檔案包含關於使用方案之喜好設定的資訊。The *.suo file contains information about your preferences for working with the solution.

雖然 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 會在您新建專案時自動建立解決方案,但是您也可以建立空白的解決方案,並在稍後加入專案。While SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) automatically creates a solution when you create a new project, you can also create a blank solution, and then add projects later.

Integration Services 專案包含封裝Integration Services projects contain packages

專案是讓您開發 Integration ServicesIntegration Services 封裝的容器。A project is a container in which you develop Integration ServicesIntegration Services packages.

SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)中, Integration ServicesIntegration Services 專案會儲存及分組與此封裝有關的檔案。In SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), an Integration ServicesIntegration Services project stores and groups the files that are related to the package. 例如,專案會包含建立特定擷取、轉送和載入 (ETL) 方案時所需的檔案。For example, a project includes the files that are required to create a specific extract, transfer, and load (ETL) solution.

在您建立 Integration ServicesIntegration Services 專案之前,您應該先熟悉這一種專案的基本內容。Before you create an Integration ServicesIntegration Services project, you should become familiar with the basic contents of this kind of project. 在您了解專案所包含的內容之後,您可以開始建立及使用 Integration ServicesIntegration Services 專案。After you understand what a project contains, you can begin creating and working with an Integration ServicesIntegration Services project.

Integration Services 專案中的資料夾Folders in Integration Services projects

下圖顯示 Integration ServicesIntegration Services 中位於 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)專案內的資料夾。The following diagram shows the folders in an Integration ServicesIntegration Services project in SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT).

Integration Services 專案中的資料夾Folders in an Integration Services project

下表描述顯示在 Integration ServicesIntegration Services 專案中的資料夾。The following table describes the folders that appear in an Integration ServicesIntegration Services project.

資料夾Folder DescriptionDescription
SSISSSIS PackagesPackages 包含封裝。Contains packages. 如需詳細資訊,請參閱 Integration Services (SSIS) 封裝For more information, see Integration Services (SSIS) Packages.
其他Miscellaneous 包含封裝檔案之外的檔案。Contains files other than package files.

Integration Services 專案中的檔案Files in Integration Services projects

當您將新的或現有的 Integration ServicesIntegration Services 專案加入方案時, SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 會建立副檔名為 .dtproj、.dtproj.user 和 .database 的專案檔案。When you add a new or an existing Integration ServicesIntegration Services project to a solution, SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) creates project files that have the extensions .dtproj and .dtproj.user and .database.

  • *.dtproj 檔案包含有關專案組態以及封裝之類項目的資訊。The *.dtproj file contains information about project configurations and items such as packages.

  • *.dtproj.user 檔案包含有關您在使用專案時的偏好設定之資訊。The *.dtproj.user file contains information about your preferences for working with the project.

  • *.database 檔案包含 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 在開啟 Integration ServicesIntegration Services 專案時所需的資訊。The *.database file contains information that SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) requires to open the Integration ServicesIntegration Services project.

Integration Services 專案中的目標版本Version targeting in Integration Services projects

SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)中,您可以建立、維護和執行目標為 SQL Server 2016、SQL Server 2014 或 SQL Server 2012 的封裝。In SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), you can create, maintain, and run packages that target SQL Server 2016, SQL Server 2014, or SQL Server 2012.

在方案總管中,在 Integration Services 專案上按一下滑鼠右鍵,然後選取 [屬性] 以開啟專案的屬性頁。In Solution Explorer, right-click on an Integration Services project and select Properties to open the property pages for the project. 在 [組態屬性] 的 [一般] 索引標籤中,選取 [TargetServerVersion] 屬性,然後選擇 SQL Server 2016、SQL Server 2014 或 SQL Server 2012。On the General tab of Configuration Properties, select the TargetServerVersion property, and then choose SQL Server 2016, SQL Server 2014, or SQL Server 2012.

專案屬性對話方塊中的 TargetServerVersion 屬性TargetServerVersion property in project properties dialog box

建立新的 Integration Services 專案Create a new Integration Services project

  1. 開啟 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)Open SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT).

  2. [檔案] 功能表上,指向 [開新檔案] ,然後按一下 [專案]On the File menu, point to New, and then click Project.

  3. [新增專案] 對話方塊的 [範本] 窗格中,選取 [Integration Services 專案] 範本。In the New Project dialog box, in the Templates pane, select the Integration Services Project template.

    [Integration Services 專案] 範本會建立一個包含單一、空白封裝的 Integration ServicesIntegration Services 專案。The Integration Services Project template creates an Integration ServicesIntegration Services project that contains a single, empty package.

  4. (選擇性) 編輯專案名稱和位置。(Optional) Edit the project name and the location.

    方案名稱會自動更新為符合專案名稱。The solution name is automatically updated to match the project name.

  5. 若要為方案檔建立個別的資料夾,請選取 [為方案建立目錄]To create a separate folder for the solution file, select Create directory for solution. 這是預設選項。This is the default option.

  6. 如果電腦上安裝了原始檔控制軟體,請選取 [加入至原始檔控制] 以將專案與原始檔控制相關聯。If source control software is installed on the computer, select Add to source control to associate the project with source control.

  7. 如果原始檔控制軟體是 MicrosoftMicrosoft Visual SourceSafe,則 [Visual SourceSafe 登入] 對話方塊會開啟。If the source control software is MicrosoftMicrosoft Visual SourceSafe, the Visual SourceSafe Login dialog box opens. 請在 [Visual SourceSafe 登入] 中,提供使用者名稱、密碼,以及 MicrosoftMicrosoft Visual SourceSafe 資料庫的名稱。In Visual SourceSafe Login, provide a user name, a password, and the name of the MicrosoftMicrosoft Visual SourceSafe database. 按一下 [瀏覽] 找出資料庫。Click Browse to locate the database.

    注意: 若要檢視和變更選取的原始檔控制外掛程式,以及設定原始檔控制環境,請按一下 [工具] 功能表上的 [選項] ,然後展開 [原始檔控制] 節點。NOTE: To view and change the selected source control plug-in and to configure the source control environment, click Options on the Tools menu, and then expand the Source Control node.

  8. 按一下 [確定] ,將方案加入 方案總管 中,並將專案加入方案中。Click OK to add the solution to Solution Explorer and add the project to the solution.

選擇專案和其封裝的目標版本Choose the target version of a project and its packages

  1. 在方案總管中,以滑鼠右鍵按一下 Integration Services 專案,然後選取 [屬性] 以開啟專案的屬性頁。In Solution Explorer, right-click on an Integration Services project and select Properties to open the property pages for the project.

  2. 在 [組態屬性] 的 [一般] 索引標籤中,選取 [TargetServerVersion] 屬性,然後選擇 SQL Server 2016、SQL Server 2014 或 SQL Server 2012。On the General tab of Configuration Properties, select the TargetServerVersion property, and then choose SQL Server 2016, SQL Server 2014, or SQL Server 2012.

    專案屬性對話方塊中的 TargetServerVersion 屬性TargetServerVersion property in project properties dialog box

您可以建立、維護和執行目標為 SQL Server 2016、SQL Server 2014 或 SQL Server 2012 的封裝。You can create, maintain, and run packages that target SQL Server 2016, SQL Server 2014, or SQL Server 2012.

使用匯入專案精靈匯入現有專案Import an existing project with the Import Project Wizard

  1. Visual StudioVisual Studio 中,按一下 [檔案] 功能表上的 [新增] > [專案] 。In Visual StudioVisual Studio, click New > Project on the File menu.

  2. [新增專案] 視窗的 [已安裝的範本] 區域中,展開 [Business Intelligence] ,然後按一下 [Integration Services]In the Installed Templates area of the New Project window, expand Business Intelligence, and click Integration Services.

  3. 從專案類型清單中選取 [Integration Services 匯入專案精靈]Select Integration Services Import Project Wizard from the project types list.

  4. [名稱] 文字方塊中,為要建立的新專案輸入一個名稱。Type a name for the new project to be created in the Name text box.

  5. [位置] 文字方塊中輸入專案的路徑或位置,或按一下 [瀏覽] 來選取一個路徑或位置。Type the path or location for the project in the Location text box, or click Browse to select one.

  6. [方案名稱] 文字方塊中輸入方案的名稱。Type a name for the solution in the Solution name text box.

  7. 按一下 [確定] ,啟動 [Integration Services 匯入專案精靈] 對話方塊。Click OK to launch the Integration Services Import Project Wizard dialog box.

  8. [下一步] ,切換到 [選取來源] 頁面。Click Next to switch to the Select Source page.

  9. 如果您要從 .ispac 檔匯入,請在 [路徑] 文字方塊中輸入路徑,包括檔案名稱。If you are importing from an .ispac file, type the path including file name in the Path text box. 按一下 [瀏覽] 導覽到您希望儲存方案的資料夾,並在 [檔案名稱] 文字方塊中輸入檔案名稱,然後按一下 [開啟]Click Browse to navigate to the folder where you want the solution to be stored and type file name in the File name text box, and click Open.

    如果您要從 [Integration Services 目錄] 匯入,請在 [伺服器名稱] 文字方塊中輸入資料庫執行個體名稱,或按一下 [瀏覽] ,然後選取包含該目錄的資料庫執行個體。If you are importing from an Integration Services Catalog, type the database instance name in the Server name text box or click Browse and select the database instance that contains the catalog.

    按一下 [路徑] 文字方塊旁的 [瀏覽] 、展開目錄中的資料夾、選取您要匯入的專案,然後按一下 [確定]Click Browse next to Path text box, expand folder in the catalog, select the project you want to import, and click OK.

    [下一步] ,切換到 [檢閱] 頁面。Click Next to switch to the Review page.

  10. 檢閱資訊,然後按一下 [匯入] ,即可根據您所選取的現有專案建立一個專案。Review the information and click Import to create a project based on the existing project you selected.

  11. 選擇性:按一下 [儲存報表] ,將結果儲存到檔案中。Optional: click Save Report to save the results to a file

  12. 按一下 [關閉] ,關閉 [Integration Services 匯入專案精靈] 對話方塊。Click Close to close the Integration Services Import Project Wizard dialog box.

將專案新增至方案Add a project to a solution

當您加入專案時,可以讓 Integration ServicesIntegration Services 建立全新的空白專案,也可以加入已經針對不同方案建立的專案。When you add a project, you can have Integration ServicesIntegration Services create a new, blank project, or you can add a project that you have already created for a different solution. 只有當您可以在 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中看到方案時,才能將專案加入至現有的方案。You can only add a project to an existing solution when the solution is visible in SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT).

將新專案加入方案Add a new project to a solution

  1. SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中,開啟您要在其中加入新 Integration ServicesIntegration Services 專案的方案,並執行下列其中之一:In SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), open the solution to which you want to add a new Integration ServicesIntegration Services project, and do one of the following:

    • 以滑鼠右鍵按一下方案,再按一下 [加入] ,然後按一下 [新增專案] 。Right-click the solution, click Add, and then click New Project.

    • 在 [檔案] 功能表上,指向 [加入] ,然後按一下 [新增專案] 。On the File menu, point to Add, and then click New Project.

  2. 在 [加入新專案] 對話方塊中,按一下 [範本] 窗格內的 [Integration Services 專案] 。In the Add New Project dialog box, click Integration Services Project in the Templates pane.

  3. (選擇性) 編輯專案名稱及位置。Optionally, edit the project name and location.

  4. 按一下 [確定] 。Click OK.

將現有專案加入方案Add an existing project to a solution

  1. SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中,開啟您要在其中加入現有 Integration ServicesIntegration Services 專案的方案,並執行下列其中之一:In SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), open the solution to which you want to add an existing Integration ServicesIntegration Services project, and do one of the following:

    • 以滑鼠右鍵按一下方案,指向 [加入] ,然後按一下 [現有專案] 。Right-click the solution, point to Add, and then click Existing Project.

    • 在 [檔案] 功能表上,按一下 [加入] ,然後按一下 [現有專案] 。On the File menu, click Add, and then click Existing Project.

  2. 在 [加入現有專案] 對話方塊中,瀏覽以找出您要加入的專案,然後按一下 [開啟] 。In the Add Existing Project dialog box, browse to locate the project you want to add, and then click Open.

  3. 專案會加入方案總管 中的方案資料夾。The project is added to the solution folder in Solution Explorer.

移除方案中的專案Remove a project from a solution

只有當您可以在 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中看到方案時,才能從方案中移除專案。You can only remove a project from a solution when the solution is visible in SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT). 看見方案之後,您就可以只保留一個專案,並移除其他所有專案。After the solution is visible, you can remove all except one project. 等到只剩下一個專案之後,SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 就不會再顯示方案資料夾,而且您也不能移除最後一個專案。As soon as only one project remains, SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) no longer displays the solution folder and you cannot remove the last project.

  1. SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中,開啟您要從中移除 Integration ServicesIntegration Services 專案的方案。In SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), open the solution from which you want to remove an Integration ServicesIntegration Services project.

  2. 在方案總管中,以滑鼠右鍵按一下專案,然後按一下 [卸載專案] 。In Solution Explorer, right-click the project, and then click Unload Project.

  3. 按一下 [確定] 確認移除。Click OK to confirm the removal.

將項目新增至專案Add an item to a project

  1. SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中,開啟包含要在其中加入項目之 Integration ServicesIntegration Services 專案的方案。In SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), open the solution that contains the Integration ServicesIntegration Services project to which you want to add an item.

  2. 在方案總管中,以滑鼠右鍵按一下專案,指向 [加入] ,然後執行下列其中之一:In Solution Explorer, right-click the project, point to Add, and do one of the following:

    • 按一下 [新增項目] ,然後從 [加入新項目] 對話方塊的 [範本] 窗格中選取範本。Click New Item, and then select a template from the Templates pane in the Add New Item dialog box.

    • 按一下 [現有項目] ,在 [加入現有項目] 對話方塊中瀏覽,以找到您要加入專案的項目,然後按一下 [加入] 。Click Existing Item, browse in the Add Existing Item dialog box to locate the item you want to add to the project, and then click Add.

  3. 新項目便會出現在 [方案總管] 中適當的資料夾內。The new item appears in the appropriate folder in Solution Explorer.

複製專案項目Copy project items

您可以在 Integration ServicesIntegration Services 專案內或 Integration ServicesIntegration Services 專案之間複製物件。You can copy objects within an Integration ServicesIntegration Services project or between Integration ServicesIntegration Services projects. 您也可以在 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 專案的其他類型之間、 Reporting ServicesReporting ServicesAnalysis ServicesAnalysis Services之間複製物件。You can also copy objects between the other types of SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) projects, Reporting ServicesReporting Services and Analysis ServicesAnalysis Services. 若要在兩個專案之間進行複製,專案必須在同一個 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 方案中。To copy between projects, the project must be part of the same SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) solution.

  1. SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)中,開啟您要使用的 Integration ServicesIntegration Services 專案或方案。In SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT), open the Integration ServicesIntegration Services project or solution that you want to work with.

  2. 展開要從中進行複製的專案和項目資料夾。Expand the project and item folder to copy from.

  3. 以滑鼠右鍵按一下項目,然後按一下 [複製] 。Right-click the item and click Copy.

  4. 以滑鼠右鍵按一下要複製到其中的 Integration ServicesIntegration Services 專案,然後按一下 [貼上] 。Right-click the Integration ServicesIntegration Services project to copy to and click Paste.

    這些項目會自動複製到正確的資料夾。The items are automatically copied to the correct folder. 如果您將項目複製到不是封裝的 Integration ServicesIntegration Services 專案,這些項目會複製到 [其他] 資料夾中。If you copy items to the Integration ServicesIntegration Services project that are not packages, the items are copied to the Miscellaneous folder.