Thursday 31 December 2015

You have created a report, the report has month name as parameter, What is best way to provide values for month name parameter?

As we have fixed set of month names and they don't change. we can add the month names as static values in report for Month Name Parameter.

If the values of parameter does change often, it is good idea to insert them in a table and use Query to extract them for Parameter in report. By doing that we don't have to make changes in report every time if we have to add or remove value. We can simply insert or delete value/s in table those will be extracted by query.

You can use below script to create table for month Names.

Create Table dbo.rpt_MonthName ( MonthName VARCHAR(50))
go
insert into dbo.rpt_MonthName values
('January'),('February'),('March'),('April'),
('May'),('June'),('July'),('August'),
('September'),('October'),('November'),
('December')

Select * from dbo.rpt_MonthName



Add Month Name Parameter Values in SSRS Report - SQL Server Reporting Services(SSRS) Interview Questions and Answers

No comments:

Post a Comment