Getting SQL script dataset in SSRS

I would like to show my SQL queries in a collapsible text field in SSRS in order to avoid misunderstandings.

Is there a way to get the SQL script of the dataset to put it in the expression field of the text field?

+4
source share
1 answer

Great question! It made me work a little, due to the vague memory that it was put up somewhere. Of course:

=DataSets("TopEmployees").CommandText 

or better yet

 =DataSets("MyDataSet").RewrittenCommandText 

The second option will include parameter substitution.

Keep in mind that this can lead to security issues if someone can find an SQL injection attack through this ...

Source: http://msdn.microsoft.com/en-us/library/dd255235.aspx

+7
source

Source: https://habr.com/ru/post/1397852/


All Articles