Category: DBCC Commands

DBCC ShrinkDatabase – I want to shrink my database.

TL;DR summary: Don’t do it. Stop reading here if you want, but just don’t do it. This post refers to shrinking your database files (mdf, or ndf files), not shrinking the log file. The log file is a completely different

Posted in DBCC Commands Tagged with: , , , , , , ,

SQL Sunday Fun – Word Search with SQL Server DBCC Commands

The following DBCC commands are all hidden in the word search.  Be aware, some of the DBCC commands are undocumented. CACHESTATS CHECKCATALOG CHECKCONSTRAINTS CHECKDB CHECKFILEGROUP CHECKIDENT CLEANTABLE DROPCLEANBUFFERS FLUSHPROCINDB FREE FREEPROCCACHE FREESESSIONCACHE FREESYSTEMCACHE INDEXDEFRAG OPENTRAN OUTPUTBUFFER PAGE PROCCACHE SHOWCONTIG SHRINKDATABASE

Posted in DBCC Commands, SQL Sunday, TSQL Tagged with: , , , , , ,

End of DBCC Command Month

As the month of May comes to an end so does DBCC command month at SteveStedman.com. I didn’t cover all the DBCC Commands this month, but here is what I did have time to cover: May 1st – DBCC CheckAlloc May

Posted in DBCC Commands Tagged with: , ,

DBCC SqlPerf

Being day 27 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC SQLPERF. Description: DBCC SQLPERF is used to do a couple different things. Show a list of all the wait stats on your SQL Server.

Posted in DBCC Commands Tagged with: , , , , , , , ,

DBCC ShrinkFile

Being day 25 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC SHRINKFILE. Description: DBCC SHRINKFILE is used to shrink an individual log in SQL Server. DBCC SHRINKFILE Syntax: Example: The following example DBCC ShrinkFile is

Posted in DBCC Commands Tagged with: , , , , ,

DBCC ShrinkDatabase

Being day 24 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC SHRINKDATABASE. When I first heard about DBCC Shrink Database (many years ago), I immediately thought “what a great feature, run this every night when

Posted in DBCC Commands 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

Posted in DBCC Commands Tagged with: , , , , , ,

DBCC InputBuffer

Being day 17 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC INPUTBUFFER. Description: DBCC INPUTBUFFER allows access to the last query run for a specific session (SPID). DBCC INPUTBUFFER Syntax: Example: The following example we

Posted in DBCC Commands Tagged with: ,

DBCC IndexDefrag

Being day 16 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC INDEXDEFRAG. Description: DBCC INDEXDEFRAG was used for to defragment indexes on SQL Server 2000, the same thing can be done with Alter Index on

Posted in DBCC Commands Tagged with: , , ,

DBCC Help

Being day 15 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC HELP. Description: DBCC HELP is used get more information about a specific DBCC Command. DBCC HELP Syntax: Example: The following example calls DBCC Help

Posted in DBCC Commands Tagged with:
Top