Author Archives: Andy Hogg

A Couple of notes on the STRING_AGG function

  Just a couple of quick notes from playing around with the T-SQL  STRING_AGG function.   As it says on the tin (well in the online documentation actually)    “STRING_AGG is an aggregate function that takes all expressions   from … Continue reading

Posted in T-SQL | 40 Comments

You’re out of order! You’re out of order! The whole result is out of order!

  The question of where NULL marks should    appear within an ordered result is an    interesting one.     The SQL standard states that NULLs should be    placed together, but it is left to the    implementation as to whether they appear    … Continue reading

Posted in T-SQL | 2 Comments

Generate SSRS Subscription E-Mail Address Lists from AD with PowerShell

It takes a lot of time to create SSRS e-mail subscription recipient lists when there are a large number of recipients, and all you have are the recipients’ human names.   I wrote a PowerShell function to take a list … Continue reading

Posted in PowerShell, Reporting Services | 1 Comment

Repairing Dropped SSAS Performance Counters

My last post covered rebuilding dropped performance counters for the SQL Server (Relational Engine). However SQLSentry Performance Advisor can also monitor Analysis Services, which from time to time is prone to the same dropped performance counter malady. If you’re suffering … Continue reading

Posted in Analysis Services | Leave a comment

SQL Sentry Tips and Tricks

I’ve used the SQL Sentry product suite (Performance Advisor and Event Manager) for some time now. It’s a great product, which has proven its value time and time again. As well as experience in implementing and using the product, I … Continue reading

Posted in Monitoring | 2 Comments

If You Can’t Stand the Heat, Stay Out of the Kitchen

The Data Warehouse luminary Dr Ralph Kimball once made an analogy in one of his books comparing a Data Warehouse to the kitchen of a busy restaurant. He said that if we were running a restaurant, we would never allow … Continue reading

Posted in Data Warehouse, T-SQL | Leave a comment

Get-Curry | Look-Disinterested – How PowerShell has a part time job working in a takeaway on the Tottenham Court Road

Stepping out the other day for a quick lunchtime takeaway, my conversation with the staff went something like this:- Me: “Hi there”. Server: <Looks at me like I’ve just asked to defecate in his hat> Me: “May I have a … Continue reading

Posted in PowerShell, T-SQL | Leave a comment

The Truth about Cats and Dogs (Why Stored Procedures don’t use Filtered Indices)

With SQL Server 2008 came an interesting enhancement – the filtered index. This is a really useful tool when trying to deal with columns containing a wildly unbalanced distribution of values. For example in a database of medical patients, where … Continue reading

Posted in Indexing | Leave a comment

Confusing Signage in SQL Server 2008 R2 Service Pack 2

The other day whilst applying SQL Server 2008 R2 Service Pack 2 to an instance, I had cause to cancel out of the installation. I did this at the pre-flight check stage by clicking the “Cancel” button. Upon doing this … Continue reading

Posted in Uncategorized | 6 Comments

Puzzling Lock Escalation Behaviour in a Partitioned Table

Here’s some lock escalation behaviour that I found interesting and thought I’d share. This is a link to all the T-SQL in this blog if you’d like to play along with me:- Play along with SQL Let’s start by creating a … Continue reading

Posted in Indexing, Table Partitioning | Leave a comment