Category: Tech and Learning

TRY, CATCH, and Transactions

The T-SQL TRY/CATCH structure (“new” in SQL 2005!) is, as the professionals say, da bomb. It’s also underused and under-understood, so let’s talk about the basics. (Or, you can skip to the summary at the end.) A group of Transact-SQL statements can be enclosed in a TRY block. If an error occurs in the TRY […]

Why should we upgrade off of SQL Server 2000?

A good many companies still have servers chugging along on SQL Server 2000 (or even, as some of us noted on Twitter, SQL Server 7.0 and 6.5) . If you’re one of those companies, and you’ve never had a problem with it, why should you upgrade?1, stability: It’s completely out of support. Microsoft won’t release […]

Use Powershell to find and punish – er, delete – rogue files

I like to know what’s on the drives that are supposed to be dedicated to data and log files. So I run a quick check of sys.master_files: SELECT LEFT(physical_name, 1) as Drive, SUM(size)*8/1024 as SizeMb FROM sys.master_files GROUP BY LEFT(physical_name, 1) ORDER BY Drive; And then I compare the numbers I got back against what Windows says. […]