Multiple tables referencing the same dataset - reporting-services

I have a single shared dataset which calls a stored procedure. I have multiple tables which use the same dataset and has filters on the table itself to only include certain records.
Does the dataset get called for each table or does it only get called once?

The easiest thing to do is run the report and see what happens in the database. In this example I have used SQL Server Profiler to view the database activity. I have tested using a simple report run through Visual Studio.
Dataset:
Report with two tables, different filters, same Dataset:
Run the report:
Check what has been recorded in SQL Server Profiler:
You can see that the Dataset query has been run only once. So in this case we can say that referencing a Dataset multiple times will not cause it to be loaded multiple times.
With SSRS it's always risky to say this will always be the case in all scenarios, but based on this example it seems like a good bet.

Related

Google Data Studio report using Cloud SQL MySQL allows only one table

I'm using Data Studio to generate a financial report dashboard and I'm connecting it to CloudSQL MySQL, but my problem here is that it only requires me one table to use as a data source, and one table wouldn't help me at all to generate a financial report at all.
Here's the image of the process of selecting a Data Source:
I tried selecting Custom Query, which according to this: https://support.google.com/datastudio/answer/7088031?hl=en
Select the CUSTOM QUERY option to provide a SQL query instead of connecting to a single table. Google Data Studio uses this custom SQL as an inner select statement for each generated query to the database.
But I don't know what query should I write to have all my database tables as data sources in Google Data Studio.
Regarding Custom Queries: Had a look online, and didn't seem to find a sample CUSTOM QUERY specific to Google Data Studio and Google Cloud SQL for MySQL, however, on StackOverflow, there are a couple of posts on BigQuery Custom Queries that involve joins, that may be useful:
Data Studio query error when using Big Query view that joins tables
BigQuery Data Studio Custom Query
An alternative is to create individual Data Sources each linked to a single table and then link multiple Data Sources through the use of Data Blending, where a common Join Key links all the respective Tables.
In addition, if you could elaborate on your exact scenario, it would perhaps help users familiar with SQL to provide a more precise solution:
How are the tables structured?
How are the tables linked?
What code have you currently tried?
I also had quite a few issues with the Custom Query using the Cloud MySQL Connector by Google for Data Studio.
The resolution for me was to not run SELECT * but rather SELECT each column by name. Not sure why it doesn't like SELECT * but hopefully this helps someone else.
Example of a successful query.
Example of successful query with join.

SSRS only displays one row when parameter is used

We have an SSRS report that has been running perfectly at multiple sites for over a year. It calls a MySQL stored procedure and displays the results in a table. For one particular customer who just migrated to a new server, this report now only shows one row of the results. It's a row that's early in the results but not necessarily the first row (not sure that has any significance). Below are steps I have taken so far to troubleshoot.
I've confirmed the procedure should return hundreds of rows by capturing the SQL via the slow query log, and running it directly on MySQL. So I've ruled out the data, the procedure, and the connection to MySQL.
This report does have grouping which I thought may be an issue, so I created a new report that calls the same procedure without any grouping and I get the same results.
As far as we know all other customers are using SQL Server 2008 R2, or 2016. This customer is using 2014. We have confirmed this customer does have all the latest SQL Server updates.
We have many other reports built in a similar way that work for this customer
We tried replacing the report RDL with another copy thinking it was perhaps corrupt
There has been one thing I've found to get all rows to show up. If I hard-code all parameters in the dataset, all rows will show up in the table. If any parameters are passed in (it doesn't matter which ones, or how many), only one row of the results shows up.
Dataset text examples
Displays one row
Call sp_report(?,?)
Displays multiple rows
Call sp_report('A','B')
These examples both return the same number of rows from MySQL according to the slow query log, but SSRS displays a different number of rows.
Any ideas would be much appreciated. I've been researching online and conducting many tests to try and figure this one out.
Update 4/16/2019
It's been 4 months and we still have not found a resolution for this. Now some other customers are starting to report this same issues. It still works for most customers and most reports, but there are a few cases where this occurs.

Why are my parameters in Tableau slowing down processor? I am connected via Custom SQL Query via a View

I have an SQL Database (SQL Server 2008 r2) that I link to Tableau via a Custom SQL Query (connected to a view in SQL). Instead of adding the new fields in the SQL Database, I am creating calculated fields in Tableau. Thedata source connected to Tableau is a viewI created by joining other views (there is a pivot I join to the main table). I want to now add the parameters from tableau as new fields in SQL and remove them from Tableau since it is bogging the tool down. What do you recommend to be the best approach in this? I have never added fields to a view and curious how this can be achieved. All of the parameters work in tableau only via the custom SQL query (the view created), but would not if I created them from the main data table in SQL.. I hope this makes sense. Thank you so much for the help! Have a great day -p
its always a good practice to create all your required fields calculation in sql table which will improve your performance. and create a extract connection with your table instead of live.

What is the best tool to use to transfer Data from Reporting Database to another?

I have a reporting database and have to transfer data from that to another server where we run some other reports or functions on Data. What is the best way to transfer data periodically like months or by-weekly. I can use SSIS but is there anyway I can put some where clause on what rows should be extracted from the source database? like i only want to extract data for a current month. Please do let me know.
Thanks,
Vivek
For scheduling periodic extractions, I'd leave to that SQL Agent.
As for restricting the results by some condition, that's an easy thing. Instead of this (and you should always use SQL Command or SQL Command From Variable over Table Name/Table Name From Variable as they are faster)
Add a parameter. If you're use OLE DB connection manager, your indicator for a variable is ?. ADO.NET will be #parameterName
Now, wire the filter up by clicking the Parameters... button. With OLE DB, it's ordinal position starting at 0. If you wanted to use the same parameter twice, you will have to list it each time or use the ADO.NET connection manager.
The biggest question you will have to answer is how do I identify what row(s) need to go. Possibilities are endless: query into the target database and find most recent modified date for a table or highest key value. You could create a local table that tracks what's been sent and query that. You could perform an incremental load / ETL Instrumentation to identify new/updated/unchanged rows, etc.

Creating report by switching between data sources and data sets

I am in a process of generating reports using SSRS. I have multiple servers with multiple oracle databases on each server. I am wondering if I can create multiple shared data sources, and shared data sets, and create one reports by switching data sets and data sources.
Otherwise I will have to create multiple reports for each data source, which can run into 100's of reports.
Any suggestion help would be highly appreciated..
Thanks
Nirmal
Almost everything in Reporting Services is an expression, including the SQL Statement of the dataset. This means it can be altered on the fly. Assuming the datasource credentials you use can access the databases you want to get to, then you just supply the database as a parameter and you're good to go. Of course, for databases on other servers you will need to use linked servers so the server you connect to can link across to the other server to access the database.
We have a table with a nice user readable name for the database such as "End of Financial Year 2009" which holds the database name for that data. Create a dataset to use this as a parameter - display the nice name as the label and get the server+databasename connection string from the value.
Then your dataset just looks like:
="SELECT * FROM " & Parameters!Database.Value & "TableName"
This assumes the databases have the same structures as far as the report's needs are concerned.
You have to set the fields manually but it gives you flexibility.