TempDB – Do This and Don’t Do That

Today I had the opportunity to present on TempDB to the Spokane SQL Server users group (PASS Chapter). The session was titled TempDB – Do This and Don’t Do That”, and it covers a bunch of tips and best practices around

Tagged with: , , , , ,

Visualizing VLF’s – Updated

A while back a wrote a blog post with a query to Visualize the VLF’s in your database. Today I have an update to that script. Here is an updated script that has adds another column called “TextStatus” to the

Tagged with: , , , , , , ,

Visualizing Log File VLF Sizing

One of my favorite queries this week is the following query that creates a text based bar chart to quickly help visualize the VLF files on any database log file. In the last month I have given the “TempDB Do

Tagged with: , , , , , , ,

TempDB – Do This and Don’t Do That

Today I am presenting my “TempDB – Do This and Don’t Do That” session at SQL Saturday Redmond. Here is the download of the presentation and samples. StedmanTempDbPresentation.zip   Some of the sample code from the session:   I hope

Tagged with: , , , , ,

Corruption Challenge 1 – how I corrupted the database

Since the corruption challenge completed yesterday, I have had several request asking how I created the corrupt database. So here is the script that I used to create the Database Corruption Challenge 1. First the initial setup. Most of this

Tagged with: , , , , , , ,

DBCC OutputBuffer

Being day 22 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC OUTPUTBUFFER. I missed a few days on the DBCC Commands due to attending SQL Saturday in Redmond, and the release of my book on

Tagged with: , , , , , ,

DBCC CheckIdent

Being day six of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKIDENT. Description: DBCC CHECKIDENT is used for check on the current value in the identity column for a table.  It also reports on the

Tagged with: , , , , , , , , , ,

Size of all databases on one SQL Server

Here is a script that I created to get the size of all of the databases on one SQL Server. Generally I stay away from temp tables, especially global temp tables, but I didn’t see a good way to do

Tagged with: , ,

Determining free disk space with TSQL

Working on a new report for the SQL Server Health reports, I needed to display the amount of free disk space on a SQL Server. EXEC MASTER..Xp_fixeddrives; Which was useful if I just wanted to look, but I needed to use

Tagged with: , , , , , , ,

Finding the names of all indexes on a SQL Server

I needed a way to list of of the indexes for an entire database, but I was running into a problem using sys.indexes that I could only see the indexes for the current database. Below is the solution that I

Tagged with: ,