The question of whether a query gains performance depending on the place I use the filtering clauses was always popping in my head. In occasions where 2 tables were involved in a join and when it was to be subjected to a where clause (to be filtered), I always preferred to do the filtering first and then join the sub query. I did not  have an idea whether this approach actually helped in a performance gain, but was comfortable with this; maybe because it was well ‘structured’ and easily ‘understandable’.

However couple of days back it struck to me to do a test once and for all. The results, were not what I expected, but helped me to understand the behavior of the SQL Server execution engine even better. This post is about what I did.

Continue Reading »


An Introduction to Database Design – SQLServerCentral.


For many SQL Server versions, RAISERROR has regarded to be a familiar component for the Developers when on SQL Server error handling. However, it seems that the newer version of SQL Server- the 2012 prepares to bid farewell for RAISERROR. A new keyword “THROW” is introduced instead and Microsoft is advising us to use this hereafter.

Continue Reading »

Ranking functions are mostly used along with the PARTITION BY and OVER clauses. however it is not mandatory to have a partition to use the ranking function. In cases where there is no partitioning, the ranking function considers the data set according what is mentioned in the FROM Clause. There are couple of ranking functions available in SQL Server 2008, Namely,

  • RANK()
  • NTILE()

Continue Reading »

UPDATE, DELETE and TRUNCATE are some of the very common DML statements we use. they get more powerful day by day. This article is dedicated on the operations these 3 statements.

Try out the following TSQL Statements in SSMS to get an idea of UPDATE and DELETE statements.

Continue Reading »

Table Value Constructors, also known as Row Constructors enable us to create a set of row value expressions to be constructed into a table.

The table value constructor can be specified in the following scenarios

  • VALUES clause of the INSERT statement.
  • USING <source table> clause of the MERGE statement.
  • In the definition of a derived table in the FROM clause.

Continue Reading »

Scheduler Job Info

About modifying columns