This trick is useful if you need to “pretend” that a named instance is the default instance, e.g. to connect a poorly coded app that…
Tag: SQL Server
I was told about a cool feature in SSMS recently: the ability to copy multiple strings to the clipboard & then cycle back through that…
Recently I came across a situation where a view took an excessive amount of time to return results when “SELECT TOP …” was applied to…
I administer SQL Servers that have several log shipping jobs, enough that manually disabling & enabling them (e.g. for maintenance windows) is tedious & time…
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…
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…