UNPIVOT in SQL Server

UNPIVOT in SQL Server is just the opposite of PIVOT. I have written an article on PIVOT which you can refer here. There is another article that is written by me on Converting column header of table to row, the same functionality can be achieved by UNPIVOT. So, let's quickly jump into implementing it. [More]

Tags: , , , ,

SQL Server | SQL Tricks

SQLCLR

In SQL Server there are certain things that are good to implement using T-SQL, but certain requirements of real world can be better implemented using CLR (Common Language Runtime). CLR is better over T-SQL when we want to do high mathematical calculations, or implement a code that involves nested loops or recursions. Database objects like stored procedure, triggers, functions etc…can be written in CLR. We can write the code using C# or VB. The example that I will be demonstrating here is implemented in C#.

[More]

Tags: , , ,

SQL Server

PIVOT TABLE IN SQL

There are instances when we want to have data displayed in Pivot table format for interactive data analysis and helping us in better decision making. This is easier to build in MS-Access or any BI tool. But this can be a little time consuming if this has to be performed by just using SQL queries. Here are few examples on different scenarios.
[More]

Tags: , ,

SQL Server