I have four parameters on my report. Three of them are required for the underlying stored procedure data source, but the fourth parameter is just used to show/hide items on the report.
If the user changes the value for that fourth parameter, is there a way to refresh the report using the existing data without running the stored procedure again? The result set won't change, only the rows that are to be displayed.
Reporting Services 2008 seems to treat each combination of report parameters as a unique set, even if some of them are internal to the report only, and not related to the stored procedure. Therefore, aside from using report caching, there is no way to prevent report server from making a round trip to the database, even if only the internal parameter changes. You basically have two options:
Turn on report caching in report server, and run all combinations of
the four parameters, so that the user will be accessing report
server's cache when she runs any report. This avoids making a round trip to the database, but only for the parameter values you've already tried.
write your underlying stored procedure with caching behavior so that it writes its results to a database table. Whenever the stored procedure is run, have it first check the table to see if the results for the current set of parameter values is already stored in the cache table, and if so return those rows to report server. This still requires a round trip, but it is faster than running the procedure again.
Related
We are using SQL Server 2019, and have an existing stored procedure which returns two result sets.
I am trying to build a new stored procedure which will call this procedure and store the data from its first result set in a temporary table so it can be used, but I can't seem to find a way to do this.
Changing the first stored procedure is not an option, and I would prefer not to duplicate it as that would mean maintaining two versions and would almost inevitably lead to problems later on.
Does anyone know how to do this?
I am new to SSIS and am after some assistance in creating an SSIS package to do a specific task. My data is stored remotely within a MySQL Database and this is downloaded to a SQL Server 2014 Database. What I want to do is the following, create a package where I can enter 2 dates that can be compared against the create date/date modified per record on a number of tables to give me a snap shot and compare the MySQL Data to the SQL Data so that I can see if there are any rows that are missing from my local SQL Database or if any need to be updated. Some tables have no dates so I just want to see a record count on what is missing if anything between the 2. If this is better achieved through TSQL I am happy to hear about other suggestions or sites to look at where things have been done similar.
In relation to your query Tab :
"Hi Tab, What happens at the moment is our master data is stored in a MySQL Database, the data was then downloaded to a SQL Server Database as a one off. What happens at the moment is I have a SSIS package that uses the MAX ID which can be found on most of the tables to work out which records are new and just downloads them or updates them. What I want to do is run separate checks on the tables to make sure that during the download nothing has been missed and everything is within sync. In an ideal world I would like to pass in to a SSIS package or tsql stored procedure a date range, shall we say calender week, this would then check for any differences between the remote MySQL database tables and the local SQL tables. It does not currently have to do anything but identify issues, correcting them may come later or changes would need to be made to the existing sync package. Hope his makes more sense."
Thanks P
To do this, you need to implement a Type 1 Slowly Changing Dimension type data flow in SSIS. There are a number of ways to do this, including a built in transformation aptly called the Slowly Changing Dimension transformation. Whilst this is easy to set up, it is a pain to maintain and it runs horrendously slowly.
There are numerous ways to set this up using other transformations or even SQL merge statements which are detailed here: https://bennyaustin.wordpress.com/2010/05/29/alternatives-to-ssis-scd-wizard-component/
I would recommend that you use Lookup transformations as they perform better than the Slowly Changing Dimension transformation but offer better diagnostics and error handling than the better performing SQL merge statement.
Before you do this you will need to add a Checksum or Hashbytes column to your SQL data for ease of comparison with the incoming MySQL data.
In short, calculate some sort of repeatable checksum as the data is downloaded into your SQL Server, then use this in an SSIS Lookup, matching on the row key, to check for changes. Where the checksum value is different for the same row it needs updating and where there is no matching row key in your SQL Data you need to insert the new row.
We have a stored procedure that takes in a set of parameters (from dimension tables) and then outputs a set of rows from which a report has to be created.
Till now this is done in a .NET app using an ORM, but is it possible to integrate it with MicroStrategy?. How do I pass the selected params (from a report prompt) to a Stored Procedure on the database and then map the results back to the report?
In the past I did a Free Form SQL (FFSQL) report in MicroStrategy on top of a PL/SQL function which returned a 'table' (Of course that was an Oracle database, more info about returning a table with a function here).
So what you are looking for is something doable.
You can use the prompts in FFSQL report as parameters for your function
Then you have to map the columns of the returned table as attributes and metrics returned by the FFSQL report
This is something I did in a very old MicroStrategy implementation to provide writeback functionality: the users were allowed to update some values in some tables and the function returned a Success or Error message.
As you can imagine this was not a standard Data Warehouse solution, it was more an hoc solution for an operational database.
My suggestion is to avoid similar solution if not necessary and prepare in advance the tables/rows that you need. Of course in your case you have already the procedure ready so you have just to figure out how to combine it with MicroStrategy.
Some useful readings:
TN37783: Instructions to use stored procedures within Freeform SQL reports in MicroStrategy 9.x against different databases
Using Prompts in Freeform SQL Reports
I have a report that runs one query in 9 different Oracle databases. If one of these databases is down, the whole report bombs. Is there any way to set it so it ignores this failure and proceeds with the rest of the report?
I'm not sure if there is a way to do what you're wanting within RS, but here's my idea:
If you can call from a SQL database -
Set up linked servers on a sql server.
Wrap the call in a stored procedure and return an alternate data set if the call fails to the linked server.
You could probably do something similar if there is an oracle server you can use.
I'm really at a loss as to how to procede.
I have a very large database, and the table I'm accessing has approx. 600,000 records. This database is accessed using an accounting application, which provides the report with the SQL query by which this report accesses the database.
My report has a linked subreport which has restrictions that are placed in the report header. When this report is run, the average time to refresh, using a very base query is 36 minutes. When adding two more items to the query, the report takes 2.5 hours.
Here is what I've tried:
cleaned up the report only leaving items in absolutely necessary - no difference
removed most formulas (removing the remaining formulas makes no time difference)
tried editing the SQL query - wasn't allowed because of the accounting application
tried flipping subreport and main report - didn't work
added other groupings - no difference
removed groupings - no difference
checked all the servers for lack of temp disc space - no issue
tried "on demand" subreport - no change
checked Parameters (discrete vs. range) and it is as it should be
tried bursting indexes, grouping on server, etc. - no difference
the report requires 2 passes. I've tried getting it down to one pass unsuccessfully.
There must be something I'm missing.
There does not appear to be any other modifications to the report using regular crystal functions. Is there any way to speed up the accessing of the data without having to go through all 600,000 records? The SQL query that accesses this data is long and has many requests. It is not something I can change.
Can I add something (formula?) that nullifies these requests? I'm reaching now...
Couple of things we have had success with is adding indexes to the databases, and instead of importing tables into the report, we instead wrote a stored procedure to retrieve the desired results.
If indices and stored procedures dont get you where you need to be you have reached the denormalise until it works part of life with a database. You might want to look at creating an MI database with tables optimized for your reporting needs; and some data transformation scripts that can extract the data from production to your MI database. Depending on what it is oracle / ms have tools to help you do this.
We use Crystal Reports with a billing system, and we had queries in the database that take over 1.5 hours to complete. This doesn't even take into account the rendering/formatting of the reports.
We created Materialized Views and force the client to refresh them daily. A materialized view is basically a database view that holds the returned dataset. The dataset is not refreshed unless you explicitly tell it to refresh.
Do you know what the SQL query is? If so, you can move the report outside the accounting application and paste the query directly into the Command in the database expert. I've had to do this in a couple of cases with another application I work with.