SQL Server 2012 ("Denali") is nearly here and with all new releases, there are always new features to know about. I am very interested to find out more about the product and my next few posts will talk about some of the new T-SQL features of SQL … [Continue reading]
What are the differences between primary keys and unique indexes in SQL Server ?

I was recently asked, what are the differences between primary keys and unique indexes? Well, they are very similar but here are the differences. Only one primary key is allowed on a table but multiple unique indexes can be added up to the maximum … [Continue reading]
GROUPING SETS performance versus UNION performance
GROUPING SETS is a way of aggregating data to produce a result set containing different sets of columns. For the SQL Server platform, it was first introduced in SQL 2008. Prior to SQL Server 2008, achieving this type of result set was possible … [Continue reading]
Database views explained

Database views are virtual tables which are built up using a SELECT query. The query may contain one or more tables. To help explain database views, here is a quick script created using SQL Server to create some tables and data. (If you want to … [Continue reading]