T-SQL Tuesday logo

T-SQL Tuesday #78– sys.dm_db_file_space_usage

May 10, 2016 Andy 4

It’s T-SQL Tuesday,  the blog party that SQL Server expert Adam Machanic (blog|twitter) started. This month’s episode is hosted by Wendy Pastrick (blog| twitter). The topic: Learn something new and blog about it SQL Server 2016 is coming out next month, and it’s chock full of new features that I … [Read More]

My 5th DBAnniversary

May 10, 2016 Andy 3

Five years ago today, I officially became a DBA: Good afternoon.  It is my pleasure to extend to you our offer of employment for the position of Database Administrator How I got there I got my first job at a software company in 2003. I had no degree, … [Read More]

How to shrink a database in 4 easy steps

April 28, 2016 Andy 9

It’s a really common question: “How do I shrink my database?” Luckily, there’s also a really common answer: “Don’t.” …but what if you really have to? Perhaps you just implemented data compression, and have 60% free space in your database. Perhaps you just deleted a … [Read More]

CONVERT() to float using scientific notation

April 20, 2016 Andy 2

Someone posted to #sqlhelp on Twitter, asking the following: “Wondered if anyone could enlighten me as to why ISNUMERIC(‘7d8’) returns 1?” Sure enough, SELECT ISNUMERIC(‘7d8′) returns a 1. WTF? d isn’t numeric! OK, sure, if you say “seven-dee-eight” out loud it sounds like a number, but “d” is a … [Read More]

How fast queries hurt performance

April 15, 2016 Andy 6

This week at work, I noticed CPU on one server seemed pretty high. I wasn’t familiar with this particular server, but based on the applications it supported, I was expecting the server to be under-utilized. I went over to vCenter to look at historical CPU … [Read More]

T-SQL Tuesday #77– My favorite SQL Server feature

April 12, 2016 Andy 2

It’s T-SQL Tuesday,  the blog party that SQL Server expert Adam Machanic (blog|twitter) started. This month’s episode is hosted by Jens Vestergaard (blog | twitter). The topic: Favorite SQL Server Feature. When I saw this topic, I was really excited. My mind started racing through all the awesome features … [Read More]

Shortcuts Cheat Sheet – SSMS & Windows

March 7, 2016 Andy 23

Edit: I’ve published an updated version of my cheat sheet. Find the latest version by in the sidebar –> I’ve presented my Shortcuts from an Impatient DBA talk a few times now, and I really love it. Everyone learns something, whether you’re a Junior Developer, or a multi-decade … [Read More]

No Picture

Decoding sql_handle

February 29, 2016 Andy 0

If you’ve ever looked at sys.sysprocesses or sys.dm_exec_requests (or a number of other DMVs), you’ve noticed there is a column called “sql_handle” that contains some binary gobbledygook. Books Online gives the (un)helpful definition as “Hash map of the SQL text of the request.” sp_WhoIsActive In … [Read More]

Data Compression: How page compression works

February 22, 2016 Andy 1

SQL Server supports two kinds of data compression on rowstore data. Columnstore compression is for a different day. You can compress heaps, clustered indexes (on both tables and views), and nonclustered indexes (on both tables and views). Compression requirements Data compression is available in SQL … [Read More]

No Picture

xp_sqlagent_enum_jobs alternative

February 18, 2016 Andy 3

What’s xp_sqlagent_enum_jobs? If you landed on this post, I’m guessing you know the answer to this, so I’ll be quick. xp_sqlagent_enum_jobs is an undocumented (and thus, unsupported) extended procedure that gives information on whether a job is currently running, when it last ran, when it runs … [Read More]