FOR XML RAW in SQL Server

In this article we will go over as how we can retrieve tabular data as XML and some XML basics. We will first go over as how we can retrieve tabular data in XML format. We will use AdventureWorks table for this. [More]

Tags: , ,

SQL Server | XML

User Defined Data Types using SQLCLR

UDTs are structs that are built in .NET framework. When we create structs(value types) in .NET framework we can only assign certain number of bytes and that's what makes it highly efficient. The limit is no more than 8KB.
[More]

Tags: ,

SQL Server

DataBase Mail

There are times when we want to send email using SQL server after a job has been accomplished. For instance, in a company every month on a certain date and time updates are to be made via web service and once that is accomplished a notification is sent to Database administrator. [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

SQL Tips and Tricks

Hello Everyone!!! Welcome to my Blog. I believe that knowledge should be shared with everyone and so I want to share all that I have learned in past 5 years of my professional experience. Currently I am working as a Senior Software Architect and Developer utilizing .NET technologies, SQL Server 2008, Dataware housing using Business Intelligence Tools like Analysis Services, Integration Services, Reporting Services, Web Services and XML.

Here is the first post of this BlogSpot which I thought could be helpful in certain scenarios that we get while working with data.

Scenario: If we have a table where we have following: [More]

Tags: , , ,

SQL Server