My current system supports Sql Query. We are integrating our application with another application which generates the Mdx query from UI based on user selection. During the integration, we need to process this Mdx query and convert into Sql query so that we can use existing api to execute and process the query results.
I am looking for an api which converts Mdx query to Sql query.
Appreciate your help on providing details on this.
Related
As question states:
Within powerBi there from the 'Get Data from SQL Server' -> connecting to the SQL Server
there are two options import and advanced. With Advanced, you can write a sql query to get the data or the default is import. This shows all the tables on the server and you can just ETL from a click.
What is the real difference?
If you are comfortable writing your own T-SQL select statement, you can use it to bypass the Power Query editor and send your desired statement straight to the SQL database. That is also handy if you have code already written out from a previous query or project, which you can just paste into the Advanced query window.
If you use the Power Query Editor to build you query step by step, you have a better visualisation about what data is returned by the previous step(s), and you can apply data manipulations after sighting the data.
Power Query uses query folding, which means that your individual steps are analysed and then translated into the most efficient SQL code before it is sent to the server.
That means that even if you don't speak T-SQL very well, you can still build efficient queries with the Query Editor, and if you feel you are an accomplished T-SQL developer, you can shortcut the Query Editor steps altogether. Of course that means that it is also possible to use "Advanced" and write clunky, inefficient T-SQL that performs slower than going through the Query Editor steps would.
In the end, it comes down to preference and familiarity. A seasoned DBA might just quickly write out a Select statement, a SQL rookie might prefer to click a few ribbon commands instead. The result can be identical in returned data and performance.
I am looking to see if the capability is there to have a custom SSMS sql query imported in SPSS (Statistical Package for the Social Sciences). I would want to build syntax that generates this query as my new dataset that I can then continue my scripted analysis. I see the basic query capability of one table from a Sql Server but I would like to create a query that joins to many tables. I anticipate the query to be a bit complex with many joins and perhaps data transformations.
Has anybody had experience or a solution to this situation?
I know I could take the query and make a table of it that SPSS can then connect to but my data changes daily and I would need a job in another application to refresh this table before my SPSS syntax would pull it and I would like to eliminate that first step by just having the query that grabs the data at the beginning of my syntax.
Ultimately I am looking to build out my SPSS syntax and schedule it in the Production Facility to run daily.
I have an excel file reading some data from an OLAP service. The query was constructed using the GUI. How can I obtain the corresponding MDX or SQL query that excel actually communicates to the OLAP server?
You can do it through SQL server profiler. Just run the profiler on Analysis Services and run/refresh your query in Excel and you will see the MDX query in the profiler.
Right click on your pivot table -> Tools -> Show Mdx
I have a question regarding incremental refresh with SQL Query on a Tableau Server.
My plan was the following:
Run the query for data till yesterday(i.e 20/7/2021) . After this I will have the full extract until that Date.
The next day(22/7/2021), I will build a flow that will do this. Each day will run the query for the previous day (21/7/2021) and UNION the data with the extract. In that way, I will have the incremental extract using the SQL Query.
Problem:
For that Procedure, I must use the Output Extract, that the flow will produce.
I tried this Procedure on my local machine, but, Tableau Prep gives me the following Error.
What's the best solution to approach this problem? Is there a better way?
I also attach the full Flow.
Thank you in advance.
What is a dynamic SQL query, and when would I want to use one? I'm using SQL Server 2005.
Here's a few articles:
Introduction to Dynamic SQL
Dynamic SQL Beginner's Guide
From Introduction to Dynamic SQL:
Dynamic SQL is a term used to mean SQL code that is generated programatically (in part or fully) by your program before it is executed. As a result it is a very flexible and powerful tool. You can use dynamic SQL to accomplish tasks such as adding where clauses to a search based on what fields are filled out on a form or to create tables with varying names.
Dynamic SQL is SQL generated by the calling program. This can be through an ORM tool, or ad-hoc by concatenating strings. Non-dynamic SQL would be something like a stored procedure, where the SQL to be executed is predefined. Not all DBA's will let you run dynamic SQL against their database due to security concerns.
A dynamic SQL query is one that is built as the program is running as opposed to a query that is already (hard-) coded at compile time.
The program in question might be running either on the client or application server (debatable if you'd still call it 'dynamic') or within the database server.