Replacement of compute by clause in t-sql - sql

i have been working on query which uses compute by clause for avg and sum operators .
As Microsoft declared this will be a discontinued feature ,what will be the replacement for this feature

Use ROLLUP which is part of the GROUP BY clause

Interestingly (although this might be a bug), the SQL Server 2005 documentation says
The COMPUTE and COMPUTE BY clauses are
provided for backward compatibility.
Instead, use the following components:
SQL Server 2005 Analysis Services
(SSAS) with OLE DB for Analysis
Services or Microsoft ActiveX Data
Objects Multidimensional (ADO MD). For
more information, see Analysis
Services Data Access Interfaces
(SSAS).
The ROLLUP operator. For more
information, see Summarizing Data
Using ROLLUP.
but the (later) SQL Server 2008 documentation merely says
The COMPUTE and COMPUTE BY clauses are
provided for backward compatibility.
Instead, use the following components:
SQL Server 2005 Analysis Services
(SSAS) with OLE DB for Analysis
Services or Microsoft ActiveX Data
Objects Multidimensional (ADO MD). For
more information, see Analysis
Services Data Access Interfaces
(Analysis Services - Multidimensional
Data).
I don't know if the omission of ROLLUP in the latter is a mistake, or if that means it's not longer a suggested way forward.

Related

"Cursor" and "FOR XML" clause in Azure data warehouse

While creating stored procedures in Azure data warehouse, I have got some error on "Cursor" and "FOR XML". So wanted to know if they are supported by Azure data warehouse or not. If not then what are the alternatives.
sample code with error msg pictures are attached herein.
Neither FOR XML or cursors are supported in Azure Synapse dedicated SQL pools (formerly known as Azure SQL Data Warehouse) as per the documentation. For cursors, either convert them to use a WHILE loop which is supported or refactor the code to use a set-based approach. Another alternative is to use something external, like Azure Data Factory or Synapse Pipelines and use a For Each loop. Another alternative is to use a nearby Azure SQL DB to do some pre-processing. You should be aware the the MPP architecture of Azure Synapse Analytics does not lend itself well to this kind of row-based processing and you should remember it's a big data platform meant for large volumes of data, millions, billions of rows and set-based approaches should be preferred.
If you are just using FOR XML to do that sleazy string concatenation trick then you should use STRING_AGG instead which is fully supported in Synapse. See this answer for a recent example. If you are actually producing XML then you will need to find an alternative method, eg a nearby Azure SQL DB.

Sql Azure Sync Dataset not supporting custom DataType of the tables while try to sync, is there any workaround for that?

The On-premises Database have tables and those tables columns types are UDTs, for this reason created same UDTs and tables using these UDTs on the cloud.
But when trying to syncing them its shows error not supporting UDTs, So am I missing something or is there any workaround to do syncing with UDTs?
Here if SQL Azure allows to create UDTs & also allows to create tables using those datatypes, then why not allow to sync?
FYI "SQL Azure" is called now "SQL Database" so if you find reference to Windows Azure "SQL Database" you can consider applied to your requirement as well.
SQL Database does not support user-defined data types, extended properties, Windows authentication, or the USE statement.
However the November 2010 update to SQL Server 2008 R2 includes support for SQL Database. The Generate Scripts Wizard now allows you to script for database version SQL Database so the scripts generated are directly compatible to be executed on SQL Database. The scripts thus generated are compatible with SQL Database and can be compiled on SQL Database without any further modifications. So your UDDT or custom data types can my transferred to SQL Database through this migration script.
If your Database is pre-SQL Server 2008, you can use the "Schema Migration with pre-SQL Server 2008 R2" section from this article.
unfortunately, there is no workaround at this time. The Data Sync Service is largely based on Sync Framework and it doesn't support UDT as well. The Data Sync Service supports spatial data types in the latest release though.

Does Microsoft Sql Server 2012 Data Quality Services support Oracle?

Does anyone know if Data Quality Services in Sql Server 2012 can be used against Oracle databases to improve their quality? I've had a look around the Sql Server site and can't determine if it can or not.
Thanks,
Steve.
There are two ways to use Data Quality Services over Oracle DBs.
Via the DQS SSIS cleansing component - you can use this as part of an SSIS flow that retrieves the data from the Oracle DB, cleans it within the SSIS flow using the DQS component, and then sends it back to the Oracle DB.
Via the use of the Linked Server functionality of SQL Server. See http://social.technet.microsoft.com/wiki/contents/articles/7540.accessing-your-data-on-remote-servers-for-dqs-operations-by-linking-servers.aspx for more information on how to do this.

Third Party Analysis Service Equivalent Component for SQL Server Express

As far as I know, the SQL Server Analysis Service (SSAS) is NOT supported by SQL Server Express Edition (2005/2008/2008R2). Does anyone know if there is any third party SSAS equivalent component / service / system (free or commercial) that does the same job?
Many thanks.
You've several Olap servers in the market, check the wikipage : OLAP Server comparison
Amongs them you've icCube as a In-Memory OLAP server with a community edition. If you ever wonder about what is going on behind an MDX query do not miss the MDX Debugger and Profiler
Depends on your requirements: if you need a space to store your multidimensional data you could use offline cubes. This is useful to release information to your final clients through MDX Queries or the pivot table component.

Can i monitor performance of particular table in sql server 2008 profiler

I want to monitor all the DML commands that run on a particular table of my database in sql server profiler. Im using sql server 2008 R2
Besides the suggested solutions, you can use a third party tool that reads SQL Server traces.
ApexSQL Comply is a SQL Server auditing tool that used SQL traces, reads relevant information from them, and stores it into its central repository database. It allows you to select the tables and event types you want to monitor. You can specify to monitor different set of events for every database.
It provides various built-in reports, where you can filter by a specific DML operation. It also has custom reports, so you can create your own reports.
You can set the tool to monitor just specific events on the table, or if you monitor all events, you can use the filters on the reports to show just the DML commands.
Disclaimer: I work for ApexSQL as a Support engineer
Yes sure - you might want to check out this video series by Brad McGehee:
Mastering SQL Server Profiler - Video Training Course
It's very useful and teaches you the basics and some more advanced concepts of SQL Server Profiler. Highly recommended.
Or here's the 10-minute short version by Brent Ozar: SQL Server Profiler Tutorial Video
In SQL Server Profiler, when you create a new profile trace, you can define filters. You can limit the stats being collected by a ton of different criteria - one of them being the Object Name , e.g. the table name you want to check for.
See Profiler Filters for more information on that particular topic.
Depending upon your exact needs you might also want to look into extended events. This has several advantages over using SQL Profiler/ SQL Trace in terms of performance, flexibility of filters, and the information available.
If you do decide to investigate this further you might find my answer to another question useful for getting up and running.