Category: SQL


The Importance of First Column in Nonclustered Index

Does it matter which column is first in an Index? Yes it does, simply because using different columns can result in different execution plans.  Introduction Let’s consider the below select statement – first we will create an index named [IX_OrderDate_ProductKey] on OrderDate and ProductKey and then an index [IX_ProductKey_OrderDate] on ProductKey and OrderDate.



Using Merge & Hashbytes for Slowly Changing Dimensions

In this post, we will have a look at how to perform slowly changing dimensions using MERGE & HASHBYTES. With this method, you can effectively perform INSERT, UPDATE & DELETE operations based on the differences found between two tables, namely, your source & target table. Note: You will be able...