Microsoft SQL Server Articles

Articles relating to issues I've encountered whilst working with Microsoft SQL Server:

SQL Server database stuck in SINGLE_USER mode

If you have a database stuck in SINGLE_USER mode, where it is not possible to set it to MULTI_USER because another process has excluding use to it, there are a couple of methods to try which will regain access to it.

The undocumented sp_MSforeachtable stored procedure

I recently came across an issue where a database had a corruption and when trying to fix it using DBCC CHECKDB, it came back with the following error: Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system table is inconsistent. Check previous errors.

SQL Server database stuck in Suspect mode

I come into the office recently to find one of our VMware hosts was throwing a wobbly and had left several virtual machines in an unresponsive state. The option for guest OS shutdown was unavailable, so they needed to be force stopped and the host needed rebooting to get everything up and running again. After powering up the VMs, one of the SQL Server databases had been left in suspect mode.