Execution Plans via T-SQL – Super Simple

I recently had to do a very quick ‘rip and tear’ (high fives for the ‘Doom’ reference!) of stored execution plans for a bit of exploratory work I was involved with. It seems like a simple, shareable piece so here it is for you to grab, use and modify as and when you need it. […]

SQL FOR JSON Tour

I’ve worked on numerous occasions with the various flavours of the FOR XML clause within SQL Server. Taking that a step further, this seemed like as good a time as ever to check out how to work with the FOR JSON clause. This clause can, simply put, be used to boil down data retrieved via […]

SQL Identity Column Monitoring Script

I recently found myself in a position whereby I needed to know how the identity columns within a given database where configured. The information I was hunting for was as follows: Identity column name and table the column belonged to. The column Data Type The last seed value used. The difference between the maximum value […]

Inspect Object Locking with T-SQL

I recently came across a scenario whereby we wanted to programmatically, via T-SQL, inspect locking behaviour on objects in a particular database when operations were being performed on given data (actually just a SELECT (WITH (NOLOCK) and DELETE statement, on a table). The requirement was to get a direct view on whether the table was […]

T-SQL Grouping Set Showcase

Greetings all, In the interim, whilst I juggle my time to get more in-depth posts rolled out (like the one surrounding Alexa skills), I back-tracked once again to look at overlooked features from the distant past of SQL 2008. I’ve chosen the topic of GROUPING SETS as the basis of this post; which basically boils […]