The OLE DB Source in SSIS is used to extract data from a wide variety of databases that supports OLE DB Connections. The SSIS OLE DB Source uses the OLE DB Connection Manager to connect with the Database Tables or Views.
Configuring OLE DB Source in SSIS
In this article, we show you how to set OLE DB Source in SSIS to extract data from SQL Server Database. To do so, please drag and drop the data flow task from the toolbox to the control flow. And change the name to Configuring OLE DB Source in SSIS.
Double-click on it will open the data flow tab. Now, Drag and drop OLE DB Source from the SSIS toolbox into the data flow region
Double click on the OLE DB source in the data flow region will open the connection manager settings. If you haven’t created the OLE DB Connection Manager before, click on the New button and configure it.
In this example, we are selecting the already created Connection Manager. Please refer OLE DB Connection Manager article
Data Access Mode: This property of SSIS OLE DB Source provides four options for us:
- Table Or View: If you select this option, It will display the list of available Tables present in the Database. And our job is to select the required tables from them.
- SQL Command: If you select this option then, We have to write our own SQL Command.
- Table name Or View name variable: For this option, you have to provide the variable name which holds the Table name or Views name.
- SQL Command from the variable: If you select this option, We have to provide the variable name which holds the Command.
The SQL Command option provides the following options
- SQL Command Text: If you are familiar with SQL Queries, write it in the empty space provided by this option.
- Build Query: It will open a Query Designer to design the required query using the Graphical User interface. Please refer to the Query Builder article.
- Parameters: If your query is parameterized (with ?), please assign the appropriate parameters using the dialog box.
- Browse: Allow us to select the Query present in the file system.
- Parse Query: This option checks whether the query was successfully parsed or not
Here, we are selecting the Table or View option. Once you choose this option, the Name of the table or the View option displays the list of available Tables and Views present in the current connection manager.
From the above screenshot, you can observe that we selected the SalesPerson table from the Adventure Works Database. Click on the preview button to see the data present in the table
Click on the columns tab to verify the columns. We can also remove the unwanted columns by unchecking them.
Click ok to finish configuring OLE DB Source in SSIS