
The SQL query source operator in the data flow palette has one output port, but does not contain an input port. Therefore, you can use the SQL query source operator only as a source operator in your data flow. You can connect the output port of the operator to a table target, a file export, or a bulk load target operator.
The SQL statement that you specify in the SQL query source operator retrieves the metadata for the columns that are queried in the SELECT statement. The database metadata describes information, such as column name, length, and data type, that is inserted into the output port of the SQL query source operator. These columns are then mapped to the input port of a target operator. The SQL statement in the SQL query source operator is run against an SQL execution database or a remote database.
SELECT employee_type, last_name, first_name, pay_rate FROM employee WHERE pay_rate > (SELECT AVG(pay_rate) FROM employee WHERE employee.job_type = 'REGULAR') ORDER BY last_nameTo reuse this SELECT statement in the Design Studio, you can use the SQL query source operator. Copy this SELECT statement and paste it in the SELECT statement field of the operator. Make sure that you have an active connection to the SALARY database in the Data Source Explorer view and that the SQL execution database is set to the SALARY database.