Aim: Very occasionally I have to process JSON in SQL Server, usually as part of a data warehouse task. Because I don’t do this often,…
The Right Join
In SQL Server 2016, DROP IF EXISTS was introduced to T-SQL for certain objects. Below are the ones that I use most frequently, alongside the…
As part of a recent SQL Server migration, I had a task to update an ODBC connection on a legacy application server running Windows Server…
The following is a quick & easy way to generate some random data in a temp table. It’s not very complex but it can be…
The following tSQLt test checks that a view is not empty. This test is primarily used to check the views that expose data to the end…
The following tSQLt test checks that all the indexes exist & are enabled as expected: CREATE PROCEDURE testSchema.[test that all indexes exist] AS BEGIN IF…
The following tSQLt test checks the historical unchanging data in a fact table to ensure that it has not been changed unexpectedly as part of…
The following tSQLt test checks the unchanging (or very slowly-changing) data in a dimension or reference table to ensure that it has not been changed…
tSQLt is a great T-SQL based unit testing framework for SQL Server. In addition to using it for unit testing, I’ve recently been (mis)using it…
The following tSQLt test checks that the basic schema of a table (or view) to ensure that it has not been changed unexpectedly as part…