# SQL Query Source

SQL Query Source enables you to retrieve data from database using a SQL query or a stored procedure. You can specify any valid SELECT statement or a stored procedure call as query. In addition, you can parameterize your queries dynamically changing values of the parameters at runtime.

{% embed url="<https://youtu.be/n8zF1hHuU0o>" %}

## **Steps**

Adding a *SQL Query Source* object allows you to transfer data returned by the SQL query. An example of what an SQL Query source object looks like is shown below.

![](https://3768133094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FH4WCHHphSt0ALtMJlqot%2Fuploads%2Flt8ZM4UC768PJz3BFJiY%2F0.gif?alt=media)

To configure the properties of a *SQL Query Source* object after it was added to the dataflow, right-click on it and select *Properties* from the context menu. The following properties are available:

* *Source Connection screen* – allows you to enter the connection information for your SQL Query, such as server name, database and schema, as well as credentials for connecting to the selected database.
* *SQL Query Source screen:* Enter the SQL expression controlling which records should be returned by this source. The expression should follow SQL syntax conventions for the chosen database provider.

For example, *select OrderId, OrderName, CreatedDtTm from Orders.*
