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 of the data warehouse update: CREATE PROCEDURE testSchema.[test that TableName metadata is correct] AS BEGIN IF OBJECT_ID(‘expected’) IS NOT NULL DROP TABLE expected; — Create a table with the expected […]

Following on from my previous post about Instant Initialization of database files, SQL Server 2016 and above allows you to set this up as part of the instance install simply by ticking a box. On the Service Accounts tab of the Server Configuration step, tick “Grant Perform Volume Maintenance Task privilege to SQL Server Database […]

As highlighted in a number of Connect items, attempting to run SQL Server Management Studio 2016 as another user (e.g. by using Shift + right-click) results in a message stating that “This task requires the application to have elevated permissions”. This issue affects Windows 10 1607 & 1703 but is apparently resolved by KB4016240. Prior to that, […]

Aim: To access hidden sheets in Excel files with protected structures using Google Sheets. In an earlier post, I described how to unhide Very Hidden Sheets in Excel. That method does not work if the workbook structure has been protected. In this example, Sheet 2 has been hidden & attempting to unhide it using the […]

Aim: To clarify the difference between filtering data in a WHERE clause or within the OUTER JOIN. When using an OUTER JOIN, there will be a difference in the results depending on whether the data is filtered in a WHERE clause or within the OUTER JOIN itself. The below queries have been run against a copy […]

Some time ago I learned that the clustered index (CI) key is implicitly included in all non-clustered indexes (NCIs). This means that if I am creating a covering index for a query that features the CI key, I don’t need to explicitly add the key to the index. Excellent – less typing for me! However, I also […]

I recently found out that when tuning stored procedures (e.g. for parameter sniffing), you shouldn’t try to tune the queries separately using local variables, e.g. DECLARE @InputParameter INT = 1; /* Query taken from stored procedure. */ SELECT [ColumeName] FROM [TableName] WHERE [Id] = @InputParameter; This is because using local variables will result in SQL […]

Kevin Kline

Career and Technical Advice for the IT Professional


Explaining the bits and bytes of SQL Server and Azure

SQL Authority with Pinal Dave

SQL Server Performance Tuning Expert


A blog about PowerShell and general Windows sysadmin stuff

Simon Learning SQL Server

I'm trying to become "better" at SQL Server and data - here's how I'm doing it!