Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

How to append a parameter to a string to make it a columnname in a sql stored procedure for creating a ssrs report ?

$
0
0

Hi All, 

I have been trying to pass a parameter to append to a string which makes it a column name, in a stored procedure for SSRS Reports.

In brief, for example my query looks like this....

I am passing an year parameter as 2015 or 2014 or 2013 based on user selection from dropdown list.

I want to select a column name such as "select status_2015,status_id from status_mst"....

Here I was trying to pass the year parameter to the status_@year as column name in stored procedure, but it is not allowing me to do this..

Can anyone show some workaround, like how to append a parameter to something and make it a column name in a stored procedure.

I was able to do it in .aspx page like status_'"+ddSeason.SelectedItem.value+"' , as column name but unable to do the same in stored procedure.

Hope someone replies me little earlier...


Viewing all articles
Browse latest Browse all 1418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>