Setting NOCOUNT in your Stored Procedures

NOCOUNT is a SQL Server setting that (when activated) will stop SQL Server from returning the “x row(s) affected” message as part of its execution. Although this message is helpful with T-SQL queries in SQL Server Management Studio, it is of little use with Stored…

Procedure for Index usage

I wrote a small stored procedure to shortcut querying Index usage in SQL Server. Check out the stored procedure body below. As you may be able to see, you just need to provide the table name you wish to filter by. You can optionally chose…

Introducing Blitz

I realised today that I haven’t written a post about Brent Ozar’s “First Responder Kit” a.k.a “Blitz”. The┬ákit is a pack of free stored procedures (and a few handy documents) to help you troubleshoot slow performing databases, and to improve the overall health of your…

Introduction to CTE

This post is just plugging a good article that I found on Common Table Expressions (CTE). I was looking at it for assistance with performance. Though I later learned that CTE is NOT useful from a performance perspective. But anyway, the article is available over…

Using StringBuilder for string concatenation

While researching up about general good C# development fundamentals, I found some information regarding string concatenation. Often my interaction with strings were mainly defining a message using String.Format(). e.g. But, there have been times where you might do a bit of string str += moreString…

Diagnosing performance issues in the database

Often it’s the database that is suspected when performance is surprisingly slow. After dealing with the situation a few times and talking to a couple of DBAs, I’ve established a few approaches to diagnosing where performance issues may lie. Scenario Imagine that you’re working on…