SSIS OLE DB Destination

The SSIS OLE DB Destination is used to load data into a variety of database tables or views or SQL Commands. OLE DB destination editor provides us the choice to select the existing table(s), View(s), or you can create a new table. In this article, we will show you how to configure SSIS OLE DB destination to load or store data into the SQL Server Database.

NOTE: The SSIS OLE DB Destination uses the OLE DB Connection Manager to create a connection with relational databases

Configuring SSIS OLE DB Destination

STEP 1: Drag and drop the data flow task from the toolbox to the control flow. Next, rename it to SSIS OLE DB Destination.

SSIS OLE DB Destination 1

Double click on it will open the data flow tab.

STEP 2: Drag and drop OLE DB Source and OLE DB destination on to the data flow region. In this example, we will explain the OLE DB destination only. So, please refer OLE DB Source in SSIS article to understand the steps involved in creating it.

SSIS OLE DB Destination 3

Before we start, please Double click on the OLE DB source to see the SQL Command we used. From the below screenshot you can see that, we are using the [Dim Products] and [Fact Internet Sales] tables present in the Adventure Works DW 2014 database

SSIS OLE DB Destination 2

SQL Command we used in the above screenshot is:

USE AdventureWorksDW2014
GO
SELECT PROD.[EnglishProductName]
     ,PROD.[Color]
     ,[SalesOrderNumber]
     ,[UnitPrice]
     ,[ExtendedAmount]
     ,[ProductStandardCost]
     ,[TotalProductCost]
     ,[SalesAmount]
     ,[TaxAmt]
     ,[Freight]
FROM [FactInternetSales]
INNER JOIN
[DimProduct] AS PROD ON
  [FactInternetSales].[ProductKey] = PROD.[ProductKey]

STEP 3: Double-click on the SSIS OLE DB Destination will open the to OLE DB Destination Editor. Use this to configure the target database. Below screenshot will show you the list of available options in the Connection Manager tab:

  • OLE DB Connection Manager: Here, you have to select the existing OLE DB Connection Manager (if any); otherwise, click on the new button to create one. For this example, we are using the already created Connection manager.
  • Name of the table or the View: Here, you have to select the existing table or view to store the data. Otherwise, click the New button to create a new destination table.
  • Keep Identity: Please specify whether you want to load the identity values into the destination table or not by checking this option. This option is available only for the fast loads, and it unchecked by default.
  • Keep Nulls: Please specify whether you want to load the NULL values into the destination table or not by checking this option. This option is available only for the fast loads, and it unchecked by default.
  • Table Lock: While loading the data, Please specify whether you want to Lock the destination table or not
  • Check Constraints: While loading the data, please specify whether the destination table Check Constraints or not.
  • Rows Per Batch: Please specify the number of rows you want to send per batch. In real-time, it is always advisable to specify the value, and this can improve your performance.
  • Maximum insert commit size: Please specify the maximum batch size here.
SSIS OLE DB Destination 4

STEP 4: Within the Data Access Mode, we have multiple options. Here, we have to select one of the following options to load data into the OLE DB destination:

  1. Table or View: Select this option to load data into the table or View.
  2. Table or View – Fast Load: Select this SSIS OLE DB Destination option to load data into the table or View and use the fast load option.
  3. Table name or View name Variable: Select this option, if you stored your destination table or View name inside the Variable and use the fast load option.
  4. Table name or View name Variable – Fast Load: Select this option, if you stored your destination table or View name inside the Variable.
  5. SQL Command: Load the data into SSIS OLE DB destination using the custom SQL Command

Remember, In your OLE DB Connection Manager

  • If you are using Microsoft OLE DB provider to access the SQL Server, use Fast load option, it means either you can use option 2 or 4.
  • If you are using SQL Server Native Client to access the SQL Server, use either option 1, 3.
SSIS OLE DB Destination 5

STEP 5: If you click on the down arrow button beside the Name of the table or the View option. It will display the list of available Tables and Views present in the current connection manager.

SSIS OLE DB Destination 6

For the time being, we are selecting the existing table Table called [SSIS OLE DB Destination]. If you haven’t created the table before, or you want to create a new table for this example, then click on the New button. It will open the new window to write your custom SQL Query to Create New table.

SSIS OLE DB Destination 7

View Existing Data..: This button will help you to see the already existing data in your target table.

STEP 6: Click on the Mappings tab to check whether the source columns exactly mapped to the SSIS OLE DB destination columns.

SSIS OLE DB Destination 8

STEP 7: Clicking OK to finish configuring the SSIS OLE DB Destination package. Let us run the package and see whether we transferred the data from OLE DB Source to OLE DB Destination or not

SSIS OLE DB Destination 9

Let us open the SQL Server Management Studio Query window to Preview the data. From the below screenshot, you can observe that we successfully loaded the incoming data into the SQL Server table using SSIS OLE DB Destination.

SSIS OLE DB Destination 10