Category Archives: SQL Server

Monitoring the progress of CreateIndex

One of the frustrating aspects of SQL Server is the lack of progress indicators. One such command falling into this pit is CreateIndex. However, this is a great link for a solution; http://sqlblog.com/blogs/michael_zilberstein/archive/2013/10/21/51415.aspx Step 1 – Before you run the following … Continue reading

Posted in SQL Server, Uncategorized | Leave a comment

Problem shrinking tempdb – could not be moved because it is a work table page

SQL holds a lot of cached information in tempdb. Until it’s cleared it won’t allow tempdb to be shrunk. So here’s a quick script you might have some joy with (obviously be aware that you will suffer the cost of … Continue reading

Posted in SQL Server, Uncategorized | Leave a comment

How to check the progress of SQL Server Shrink Database

Periodically run; SELECT GetDate(),percent_complete, start_time, status, command, estimated_completion_time, cpu_time, total_elapsed_time FROM sys.dm_exec_requests where command = ‘DbccFilesCompact’

Posted in SQL Server, Uncategorized | Leave a comment

How to Backup SQL to Azure Storage

SQL Server 2016 allows you to backup a database to Azure Storage. I found the information about this to be disjoint at best. So, if you want to do an old style (non-snapshot) backup of a database this is how … Continue reading

Posted in Azure, SQL Server | Tagged | Leave a comment

SQL Server – The log cannot be rebuilt because

I had the blood-drawn-from-face moments when a database stated is was ‘pending recovery’. Ultimately the transaction log file was broken. Actually I didn’t care about that because I knew it was pretty much all read-only data. So how to recover … Continue reading

Posted in SQL Server, Uncategorized | Leave a comment

SQL Server with external drives – pending recovery

When you are developing a SQL Server database you might want to use External Storage devices. Beware of a couple of slight gotchas. When you restart your machine SQL Server may start before the drives become available. If this happens … Continue reading

Posted in SQL Server, Uncategorized | Leave a comment

How to connect to a SQL2008 machine

Ok I admit it, I’m a developer and configuring access to SQL Server is not my bag (baby). SQL 2005 had a nice big Surface Area Configuration button than just allowed access from clients, so I ignored what it was … Continue reading

Posted in SQL Server | Leave a comment