The DataReader source consumes data from a .NET provider and makes the data available to the data flow.
You configure the DataReader source by providing the SQL statement that defines the result set. For example, a DataReader source that connects to the AdventureWorks database and uses the SQL statement
SELECT * FROM Production.Product extracts all the rows from the Production.Product table and provides the dataset to a downstream component.
The DataReader source supports the System.Object data type by converting columns that have this data type to the DT_NTEXT Integration Services data type. To change the data type to a type more appropriate for your data, you can add a Data Conversion transformation after the DataReader source. For more information, see Data Conversion Transformation.
The DT_NTEXT data type can be converted only to the DT_BYTES, DT_STR, and DT_WSTR data types; therefore, you may have to include more than one data conversion to obtain the data type that you want. For more information about the Integration Services data types and the supported data type conversions, see Integration Services Data Types and Cast (SSIS).
The DataReader source includes the SQLCommand and the CommandTimeout custom properties. The SQLCommand property can be updated by a property expression when the package is loaded to dynamically update the SQL statement that the DataReader source uses. For more information, see Integration Services Expression Reference, Using Property Expressions in Packages. The CommandTimeout property specifies the number of seconds before the SQL command times out. The value 0 indicates that the command never times out. For more information, see Source Custom Properties.
This source uses an ADO.NET connection manager to connect to a data source, and the connection manager specifies the .NET provider. For more information, see ADO.NET Connection Manager.
The DataReader source has one regular output and one error output.
Troubleshooting the DataReader Source
Starting in Microsoft SQL Server 2005 Service Pack 2 (SP2), you are able to log the calls that the DataReader source makes to external data providers. You can use this new logging capability to troubleshoot the loading of data from external data sources that the DataReader source performs. To log the calls that the DataReader source makes to an external data provider, enable package logging and select the Diagnostic event at the package level. For more information, see Troubleshooting Package Execution.
Configuring the DataReader Source
You can set properties through SSIS Designer or programmatically.
For more information about the properties that you can set in the Advanced Editor dialog box or programmatically, click one of the following topics:
For more information about how to set properties, click one of the following topics:
- How to: Set the Properties of a Data Flow Component in the Properties Window
- How to: Set the Properties of a Data Flow Component Using the Advanced Editor
Help and Information
12 December 2006
14 April 2006
5 December 2005