Paul Randal, please mentor me

Today I’m going to go a bit off schedule and deviate from my usual technical content. Paul Randal (b | t) is the owner of SQLSkills which is a consulting and training organization. A few weeks ago Red-Gate announced their Tribal Awards…

Optimizing for unknown and NULLs

Optimizing for unknown and NULLs

The other day I had an interesting conversation about something that sounds counter-intuitive. If NULL means unknown or missing, then does OPTIMIZE FOR UNKNOWN mean to optimize for NULL? Let’s take a step back for a moment and put this…

Active sessions and block duration

Active sessions and block duration

As a DBA, we all need the ability to take a quick glance at the currently active processes on our servers. A lot of times we do this during a problem such as transaction blocking. The first tool that normally…

How to log errors with T-SQL try/catch

How to log errors with T-SQL try/catch

Today a co-worker of mine (Brad) asked a question regarding the usage of T-SQL’s Try-Catch block. Brad wanted to write to a table every time a stored procedure failed so that it was easy to recover the error messages and…

SQL Server Index Column Order

SQL Server Index Column Order

At times I am in a position to advise development teams on their practices. What I have learned from this experience is that there is always a demand for me to reduce what I tell them to developer terms. Before the developers…

PowerShell Profile Tips

Automation is one of the purposes for using PowerShell. Automation is a funny thing, however. You can perform steps of automation almost to infinity. If you write a function that replaces 200 lines of code with 1 function call, that’s…

Failing over AlwaysOn Availability Groups

Failing over AlwaysOn Availability Groups

Merry Christmas Eve! A few weeks ago I posted on Availability Group fail-over tests with PowerShell. That post covered the basics of how to check the Availability Group’s state and perform the commands for conducting a zero data loss fail…

My Epic Life Quest – Level 2 Achieved

DING – LEVEL 2 !!! I am excited to announce that I have achieved level 2 in My Epic Life Quest. My epic life quest is an idea that I got from Steve Kamb via Brent Ozar. As life goals…

Start and Save Hyper-V VMs with PowerShell

I use Windows 8 or Windows Server 2012 R2 on most of my local workstations between home and work. In order to conserve memory, I turn my Hypver-V lab environments on and off as I need them. Given that my…

Availability Group fail-over test with PowerShell

I have a number of SQL Server Availability Groups in my organization. Of them, most are multi-site configurations for disaster recovery. Naturally, the latency that a separate data center implies is more than my application can handle for its writes….