Extract Data by Using the OLE DB Source
To add and configure an OLE DB source, the package must already include at least one Data Flow task.
To extract data using an OLE DB Source
In SQL Server Data Tools (SSDT) , open the Integration Services project that contains the package you want.
In Solution Explorer, double-click the package to open it.
Click the Data Flow tab, and then, from the Toolbox, drag the OLE DB source to the design surface.
Double-click the OLE DB source.
In the OLE DB Source Editor dialog box, on the Connection Manager page, select an existing OLE DB connection manager or click New to create a new connection manager. For more information, see OLE DB Connection Manager.
Select the data access method:
Table or view Select a table or view in the database to which the OLE DB connection manager connects.
Table name or view name variable Select the user-defined variable that contains the name of a table or view in the database to which the OLE DB connection manager connects.
SQL command Type an SQL command or click Build Query to write an SQL command using the Query Builder.
The command can include parameters. For more information, see Map Query Parameters to Variables in a Data Flow Component.
SQL command from variable Select the user-defined variable that contains the SQL command.
The variables must be defined in the scope of the same Data Flow task that contains the OLE DB source, or in the scope of the same package; additionally, the variable must have a string data type.
To update the mapping between external and output columns, click Columns and select different columns in the External Column list.
Optionally, update the names of output columns by editing values in the Output Column list.
To configure the error output, click Error Output. For more information, see Configure an Error Output in a Data Flow Component.
You can click Preview to view up to 200 rows of the data extracted by the OLE DB source.
To save the updated package, click Save Selected Items on the File menu.