This opens the Advanced Editor for DataReader Source. At first, you need to
indicate a connection manager that the DataReader can use.
3. In the Advanced Editor for DataReader Source that gets displayed click on
the Connection Managers tab.
4. Click on an empty area (in grey) below the list heading, Connection Manager.
Here, you will see the connection manager that you added in step 1.
5. Choose this Connection Manager.
6. Next, click on the Component Properties tab to open the properties of the
DataReader component.
Here, you will notice that this requires an SQLCommand (the only empty
field now).
7. Click on the ellipsis button along its side to display a text editor where you
can type in your SQLCommand.
You may also directly type-in the SQL Command:
SELECT CustomerID, CompanyName, Address, City, PostalCode
FROM Customers
Transferring Data to a Microsoft Excel File
[ 102 ]
8. Click on the Refresh button.
This query will allow the DataReader to read the data from the five columns.
A sample of the table data is shown in the following screenshot, taken from
SQL Server 2005 Management Studio. If you recall, these were the same
columns that were used in the previous chapter as well.
9. Click on the Column Mappings tab.
This will open the Column Mappings page showing the columns that are the
output of the DataReader.
In the last tab on this editor, Input and Output properties, you can add/
remove items from the External Columns, the Output Columns and the
DataReader Error output.
Pages:
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86