Recently while working with a client I was faced with some seriously convoluted code to count the number of days between a couple of dates.
Usually this is not a big issue, a simple datediff() works, but this also had to take… Read more
Why bother encrypting?
As a SQL Server DBA I am primarily responsible for making sure my client’s data is protected and available amongst other things. In many cases I have gone to clients and projects to find that sensitive data is not… Read more
I was going through some notes I had from previous projects and came across a sample script for created a Type 2 Slow Changing Dimension (SCD) in a database or data warehouse.
A Type 2 SCD is one where new records are added, but old ones are marked as archived… Read more
Last night a client tried to ruin a script to enable Read_Committed_snapshot on a SQL database. There were so many connections that kept popping up, even after restarts, that they were not able to change the setting.
As a fix I provided the script below.
Basically it uses the active… Read more
I was doing some simple tuning of procedures for a client when I came across some delete statements that I wanted to look into some more. They were filtering based on values in a temp table.
In a majority of cases I have come across at clients a row is… Read more