reportserver-401257-create-reports-web-report-designer-bind-a-report-to-data-bind-to-sql.md
This tutorial describes how to bind a report to a SQL database.
Define data models that obtain the data from your data providers. For this tutorial, prepare a data model connected to a SQL database.
Open an existing report or create a new report as described in the Create and Customize Reports document to get started.
To obtain a report’s dynamic data from an external data source, do the following:
Click the main menu button and select Add Data Source to create a new data source.
On the first page of the invoked Data Source Wizard , select a SQL data model and click Next to proceed.
On the next page, choose tables, views and/or stored procedures to add to the data source. You can also create custom queries. To do this, click the Queries category’s plus button.
Specify key fields to define master-detail relationships between queries. Click the plus button next to the master query, choose the detail query to add a new relationship and specify the relationship condition as shown in the following image:
Click Finish to complete the wizard.
The Field List displays the data source hierarchy after you connect a report to data.
The created data source is assigned to the report’s Data Source property.