Report Data Sources (SSRS)
In SQL Server Reporting Services (SSRS), a data source defines the connection information required to retrieve data for a report. Data sources can be shared (used by multiple reports) or embedded (specific to a single report).
Data Source Types
- SQL Server
- Oracle
- OLE DB
- ODBC
- XML
- SharePoint List
- Microsoft Exchange
Shared Data Sources
Shared data sources are stored in the report server folder structure and can be referenced by multiple reports. They simplify management and promote consistency.
Benefits
- Centralized connection string management.
- Security credentials can be configured once.
- Easy to update without modifying individual reports.
Embedded Data Sources
Embedded data sources reside within a single .rdl file. They are useful when a report requires a unique connection that shouldn't be shared.
Creating a Data Source
- Open SQL Server Data Tools (SSDT) or Report Builder.
- Right‑click the Shared Data Sources folder and select New Data Source.
- Provide a name, select the data source type, and configure the connection string.
- Choose the authentication method (Windows, SQL Server, or stored credentials).
- Click Test Connection to verify settings.
- Save the data source.
XML Definition of a Shared Data Source
<DataSource Name="SalesDB">
<DataSourceReference>SharedDataSources/SalesDB</DataSourceReference>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>Data Source=SERVERNAME;Initial Catalog=Sales;Integrated Security=True</ConnectString>
<IntegratedSecurity>True</IntegratedSecurity>
</ConnectionProperties>
<Prompt>Enter your credentials</Prompt>
</DataSource>