Uploading data to create a table for use in SSRS - sql-server

I am currently working on developing reports on SSRS. This specific report was initially built on excel using a query that is quite comple. I noticed it pulls about 2 million records and thus slow due to several joins and subqueries. I was trying to create a table instead dedicated to have this data readily but i got an error (query taking too long ) and timed out while trying to execute it as a SELECT * INTO ReportTable From. Please any assistance is well appreciated. Thanks

You can either run this directly on the DB host, or you can create an SQL Server Agent job that performs this. It should prevent the time out.

Related

MDX query is very slow in at the time of loading through SSIS data flow task

Hi we have a ssis package which is loading data from a SSAS cube.So we are using mdx query inside the data flow task for fetching data from Cube.But at the time of fetching data from cube, the package is taking huge time. it is first valiadting then executing so total 1 hour for some 1000 rows.. So is there any option us there to optimize??.. in mdx we have ony select query for one meausre and some 4 dimension.. and same mdx giving result in query window from cube in seconds.. so where is the problem??
Try creating a linked server on the database server to the cube server and run an OPENQUERY command to execute the MDX. This data source can then be mapped to the destination. I have heard that it's usually the better way of obtaining results from a multidimensional source.
References - 1 and 2. I have also heard that this is a great tool. If you are open to using open source code then, try this out as well.

What would be the best method for building Dynamic Reports from my SQL DB Data?

I am building a simple database with about 6-7 tables. I will be setting a schedule to do a clean import from a .txt file.
I want to take this data and create a report, like I would do in an excel spreadsheet, convert it to a pdf and post it to our company intranet for those interested to access it.
I'm trying to think of the best way to build my report. Would I just use an excel spreadsheet with a direct connection to the database? Would I create some sort of console application (c/c#/vb/vb.net) that would query the db, generate the report in an excel file, convert to pdf and save?
I'm quite comfortable in these different languages, just not as experienced in the reporting services (although I do have a lot of experience working with EXCEL and VBA Macros) but I want to get into it (SSRS) and get familiar with it as I will be doing a lot of projects like this in the future. This is seems like an easy one to get my hands dirty with and learn and build off of.
Any insight or suggestions would be greatly appreciated.
Thanks so much!
My suggestion:
Create desired SQL queries to retrieve the data in desired form
Link these queries to your Excel sheet, perhaps directly in form of pivot tables for aggregation of results
Using VBA, you can easily create PDF from the data at the click of a button
The initial design will be time intensive, but after that, everything is automated and one just needs to press the button that creates the PDF.
How to link Access queries to your Excel file:
Data --> Get external Data
You can easily refresh all data whenever you open the Excelsheet by using the code below in the On Open event of the workbook:
ThisWorkbook.RefreshAll
If you need further clarification, do not hesitate to ask
If your end goal is to create a PDF that will be out on your intranet then I would create the report in SSRS. Then you can schedule it to run and output a PDF to your network location.
I've had good experiences using a pivot table in Excel which is a connected table to your SQL database.
In the connection parameters in Excel there is a field where you can define your SQL query, whether it be to call a stored procedure or just a simple SELECT statement.
The main reason I prefer a pivot table SQL connection rather than a normal table connection is because if you have a chart that references the connected table, the chart formatting will be reset when you refresh your connection (if you need to updated your report).
If I use a chart that references a pivot table (or a pivot chart) then the formatting is retained.

Selecting from a specific SSAS Database

I'm trying to set up a prediction service for my database, I'm using OPENQUERY to ask the SSAS for predictions on my datasets. So far everything has worked fine but when I tried to scale the service I ran into some problems.
My MSSQL database server is linked to my SSAS database server using a Linked Server construction. (Linked_AS)
I've run into the problem that I cannot seem to specify a specific SSAS database that I would like to select my mining structure from. The DMX syntax simply doesn't seem to support it.
For reference here is the select query.
SELECT * from OPENQUERY(Linked_AS, 'SELECT flattened top 1 timeindex FROM fillpercentageDaily.CASES
order by timeindex desc'));
This query runs fine but seems highly ambiguous as there is no way for me to determine which database it is selecting from.
Workaround I can think of:
Making sure that all of my mining structure names are unique across all databases.
However this does not seem practical. Is there anyone that has some insights?

MS Access - link to query in another Access database

How can I link query from another MS Access database? I know I can easily link tables, But I don't know how to link queries. The query takes data from many tables which I don't want to link.
You can do it this way:
SELECT [RemoteQueryname].* FROM [RemoteQueryname] IN 'C:\RemoteDatabase.mdb'
I have tested with databases locally on my machine and runs flawlessly. The only note I would like to point out is before running the query check to make sure the remote databse is closed or it will crash the one trying to do the query.
The "official" way, by which I assume you mean using the buttons on the ribbon, TMS, would be to use a Make Table Query. Of course, to update the linked data, you would have to run the make table query every time.

Best Practise: presenting some data (making a report) from SQL Server

I have many SQL Server databases, each with a few tables containing important (from my point of view) information. I check the data (retrieving for example maximum or minimum value) within those tables using T-SQL queries.
Since I don't want to create views for each of the databases, I'm thinking about most convenient, easier and simply the best way to prepare summary which will be updating each time when opened.
The output file (or web page) will be used internally within technical team. All members can log into database using Windows authentication.
My idea was:
Excel + dynamic T-SQL --> I want to connect to database and execute T-SQL (cursor will go through all database names)
PowerShell (showing table using Out-GridView cmdlet)
PHP - first I will ask about all database names (executing select name fromsys.databases` and then execute query for each DB)
What is in your opinion best way? Do you have any better (from programmers point of view) way of getting such report/data?
You can use SSRS Reports .You have the options of exporting the report data to several formats such as pdf ,excel ,word .You can create a dataset for all your database .Since you are interested in showing aggregation and summation of values ,SSRS reports will be pretty useful in these cases .

Resources