One of the common CheckDB errors that I see is the Message 824, level 24. This is something that I regularly work to repair for customers with great success.   DBCC results for ‘YourDatabaseName’. CHECKDB found 0 allocation errors and 0 consistency errors in database ‘ YourDatabaseName’. Msg 824, Level 24, State 2, Line 1 SQL Server detected a logical …

CheckDB Error Msg 824 level 24 Read more »

IF you are browsing your error log and come across an error message stating that “1 transactions rolled forward in database ‘msdb’”, or “X transactions rolled back in database ‘msdb’” you might be a bit alarmed. You might also notice similar error messages for master, tempdb or user databases.   How can this be a good thing? Why are transactions …

Transactions Rolled Back in Database Read more »

Congratulations to Randolph West who won the corruption challenge this week with the following solution which restored all of the data. First he restored the database to get started. Note some of his code and comments have been reformatted to better fit in the blog format. Restore database. I use KEEP_CDC and KEEP_REPLICATION because of the hints you dropped in …

Corruption Challenge Week 4 – The Winning Solution Read more »

Welcome to the DataBase Corruption Challenge, this is an about weekly blog challenge where I will post a corrupt SQL Server database with some details on what happened to it. If at this point you are already a bit irked by my use of capitalization in the DataBase Corruption Challenge, and the acronym of DBCC that I have used to …

Introducing the DataBase Corruption Challenge (DBCC) – Week 1 Challenge Read more »

As I have presented my Common Table Expressions presentation many times, and as part of writing the Common Table Expressions Book I have created some sample database scripts to use. Once you load up the script into SSMS and refresh the databases tree item, you will see a new database called cte_demo that includes 2 tables. dbo.Departments The first table is called …

Sample Database for Common Table Expressions Read more »

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 Amazon.com.  I am now back on track to finish out the rest of the month with more DBCC commands. Description: …

DBCC OutputBuffer 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 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 one of DBBC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKALLOC. Description: DBCC CheckAlloc checks and can repair disk space allocation structures for a database. DBCC CheckAlloc checks the allocation for all pages in the database compared to their internal structures representing those pages. When you run DBCC CheckDB it internally runs the equivalent of DBCC …

DBCC CheckAlloc Read more »