Creating an SSIS Package to consume a table and write the recordset into a text file.
Rename package to match project
Next, Create data source allowing access to sql table. create connection manager.
Next, select the source database.
Create a data flow task and give it a name indicating its purpose.
Double-click the task to edit it and add a connection manager for the database.
Drag and OLE Db Datasource unto the designer.
Double-click it and enter sql to extract table records.
You may click preview to confirm desired resultset.
Drag a flat file destination object unto the designer.
Connect the OLE Db Datasource to the Flat File Destination object by dragging its green arrow to connect the two objects.
Create and configure the flat file connection manager to write a delimited list of employee records to a text file with column names appearing in the header row.
Execute the package and notice the number of records returned.
Locate the text file previously configured to view the results.