70-466 · Question #151
A multinational retailer has retail locations on several continents. A single SQL Server Reporting Services (SSRS) instance is used for global reporting. A SQL Server Analysis Services (SSAS) instance
The correct answer is C. ="Data Source=" & Parameters!ServerName.Value & ";Initial Catalog=RetailSales". SSRS dynamic connection strings for SSAS must use 'Data Source=' syntax and reference report parameters via the VB expression syntax using Parameters!ParameterName.Value.
Question
- A report parameter named ServerName must be defined in each report. When running a report, users must be prompted to select a server instance.
- The report data source must use the Microsoft SQL Server Analysis Services data source type. You need to create a data source to meet the requirements. How should you define the expression that is assigned to the connection string property of the data source?
Options
- A="Server=" & Parameters!ServerName.Value & ";Initial Catalog=RetailSales"
- B="Data Source=@ServerName;Initial Catalog=RetailSales"
- C="Data Source=" & Parameters!ServerName.Value & ";Initial Catalog=RetailSales"
- D="Server=" & Parameters!ServerName.Value
- E="Server=@ServerName;Initial Catalog=RetailSales"
How the community answered
(53 responses)- A2% (1)
- B4% (2)
- C75% (40)
- D13% (7)
- E6% (3)
Why each option
SSRS dynamic connection strings for SSAS must use 'Data Source=' syntax and reference report parameters via the VB expression syntax using Parameters!ParameterName.Value.
This uses 'Server=' which is the SQL Server relational engine connection string keyword; SSAS connections require 'Data Source=' instead.
'@ServerName' is T-SQL parameter notation and is not recognized by the SSRS expression engine as a report parameter reference - it would be treated as a literal string.
The SSAS data source type requires 'Data Source=' as the connection string keyword, not 'Server='. SSRS expressions that embed report parameters must use the concatenation operator (&) with Parameters!ServerName.Value to dynamically inject the selected server at runtime, making the connection string valid and fully parameterized.
This uses the incorrect 'Server=' keyword for SSAS and also omits the required 'Initial Catalog=RetailSales' portion needed to specify the database.
'@ServerName' is not valid SSRS expression syntax for referencing a report parameter, and it also uses the incorrect 'Server=' keyword for an SSAS connection string.
Concept tested: SSRS dynamic SSAS connection string with report parameters
Source: https://learn.microsoft.com/en-us/sql/reporting-services/report-data/analysis-services-connection-type-for-mdx-ssrs
Topics
Community Discussion
No community discussion yet for this question.