Tag Archives: T-sql


Detecting T-SQL code smells – Part 3

Detecting T-SQL code smells – Part 3

This is The third and last part of the Detecting T-SQL code smells series. Within this post I will cover how the solution can be customized by adding new validation rules

Read More →

Detecting T-SQL code smells – Part 2

Detecting T-SQL code smells – Part 2

For the second part of this series, I’m relying on a project hosted on codeplex which can be found by the name TSQL Code Smells Finder.  The solution consists out of 3 files (one PowerShell script, a text file containing a list with possible errors and a whitelist file) and build within PowerShell, therefore it’s not that complicated to extend the solution later.

Read More →

Detecting T-SQL code smells – Part 1

Detecting T-SQL code smells – Part 1

When moving a new SQL server database into production or taking over maintenance duties for large and heavenly used databases, you might want to perform some audit’s allowing you to ask some additional questions when the development team is still available or just being aware of possible performance issues / special maintenance routines etc.

Read More →

Executing SQL Statements using PowerShell

Executing SQL Statements using PowerShell

The SQL Server SMO client API can be used query and alter settings and objects within your SQL Server instances, however in case you want to query your user database, you will run into some limitations. The client API simply isn’t aware of your data objects and therefore not exposing a typed scheme. Fortunately, it’s pretty easy to accomplish when using the SQL Server PowerShell Module (SQLPS)

Read More →

Scripting SQL Server installations

Scripting SQL Server installations

I was addressing performance issues onsite just a couple of weeks ago and while waiting for the right authorizations, access tokens and whatever you need nowadays to just run some scripts…, one of the developers approached me and asked for some insights on how to Scripting SQL Server installations.

Read More →

Management Studio Custom Shortcuts

Management Studio Custom Shortcuts

A DBA recently attended me on the “Query Shortcuts” option within Management Studio. Now, I have to admit that I’m lazy from time to time and a horrible typist on Monday mornings and therefore using the option a lot, especially while debugging.

Read More →

sp_what: Seek and ye shall find

SQL Server SP_what

On-site performance tuning analysis can be as rewarding as it is frustrating. There are some aspects you just can’t control; Ranting managers or dealing with a passive DBA, which often stands behind you with popcorn and drinks. Fortunately, you can prepare your scripts in advance based as i did based on prior leanings.

Read More →