Being day 12 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC FREEPROCCACHE. Description: DBCC FREEPROCCACHE is used for purge all of the parsed query plans out of memory. This is commonly used in development environments, but not as common in a production environment. Use in a development environment is common, for instance when you are …

DBCC FreeProcCache Read more »

Being day ten of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC DROPCLEANBUFFERS. Description: DBCC DropCleanBuffers is great to use in a development or test environment to flush all of the clean data pages out of memory to use for performance testing purposes.  This can be combined with DBCC FreeProcCache to simulate the state of a freshly …

DBCC DropCleanBuffers Read more »

Being day nine of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC DBREINDEX. Microsoft recommends avoiding the use of DBCC DBREINDEX. DBCC DBReIndex has been deprecated  meaning that Microsoft has announced that DBCC DBReIndex will be going away in future versions of SQL Server Over time as you insert, update and delete from tables various clustered and …

DBCC DBReIndex Read more »

Being day eight of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CLEANTABLE. Many times I have worked on a database that has evolved over 10 or more years of changes from different developers and DBAs. One of the signs I see in databases like this is the waste associated with obsolete columns.  For instance someone …

DBCC CleanTable Read more »

Being day seven of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKTABLE. Description: DBCC CheckTable is used to check the structure of a table to verify the integrity of every data page associated with that table, and all of the indexes associated with that table. If you have used DBCC CheckDB, and a problem has …

DBCC CheckTable Read more »

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 largest value in that column. DBCC CheckIdent can also be used to update or set the next identity value on …

DBCC CheckIdent Read more »

Being day five of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKFILEGROUP. Description: DBCC CHECKFILEGROUP is used for a specific filegroup to check the disk allocation and structural integrity of all tables and indexed views. DBCC CHECKFILEGROUP Syntax: filegroup_name – The name of the filegroup to be checked. Ddefault (or if 0 is specified) = …

DBCC CheckFilegroup Read more »

Being day four of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKDB. For more info on DBCC see the Database Corruption Challenge. DBCC CheckDB Description: DBCC CHECKDB is used to check the physical integrity of the entire database. DBCC CHECKDB is used to detect corruption in the database, and should be run regularly.  This is …

DBCC CheckDB for Database Consistency Read more »

Being day three of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKCONSTRAINTS. Description: DBCC CHECKCONSTRAINTS is used to check the integrity of one constraint, all constraints for a table, or all constraints for a database. DBCC CHECKCONSTRAINTS Syntax: Example: To check constraints for an a single table: For instance to check the constraints on the …

DBCC CheckConstraints Read more »

Being day two of DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKCATALOG. Description: DBCC CheckCatalog checks the catalog integrity for a given database. DBCC CheckCatalog is less intensive than DBCC CheckDB, as CheckCatalog checks that every data type in syscolumns has a matching entry in systypes and that every table and view in sysobjects has at …

DBCC CheckCatalog Read more »