SQL SERVER – INNER JOIN using LEFT JOIN statement – Performance Analysis

Just a day ago, while I was working with JOINs I find one interesting observation, which has prompted me to create following example. Before we continue further let me make very clear that INNER JOIN should be used where it can not be used and simulating INNER JOIN using any…
Read More

SQL SERVER – Transaction and Local Variables – Swap Variables – Update All At Once Concept

This article is inspired from two sources. Let us learn today about how to swap variables by updating everything at once concepts.

1) My year old article – SQL SERVER – Effect of TRANSACTION on Local Variable – After ROLLBACK and After COMMIT
2) Discussion with SQL Server MVP – Jacob Sebastian – SQLAuthority News – Author Visit – SQL Hour at Patni Computer Systems

I usually summarize my article at the end, but this time let me summarize first and we will understand the article next.

Read More

SQL SERVER – Introduction to CLR – Simple Example of CLR Stored Procedure

CLR is abbreviation of Common Language Runtime. In SQL Server 2005 and later version of it database objects can be created which are created in CLR. Stored Procedures, Functions, Triggers can be coded in CLR. CLR is faster than T-SQL in many cases. CLR is mainly used to accomplish task…
Read More

SQL SERVER – Retrieve – Select Only Date Part From DateTime – Best Practice – Part 2

A year ago I wrote post about SQL SERVER – Retrieve – Select Only Date Part From DateTime – Best Practice where I have discussed two different methods of getting datepart from datetime. Method 1: SELECT DATEADD(D, 0, DATEDIFF(D, 0, GETDATE())) Method 2: SELECT CONVERT(VARCHAR(10),GETDATE(),111) I have summarized my post…
Read More