{"id":956,"date":"2009-02-13T15:33:00","date_gmt":"2009-02-13T15:33:00","guid":{"rendered":"\/blogs\/paul\/post\/Corruption-errors-Msg-5242-Level-22.aspx"},"modified":"2009-02-13T15:33:00","modified_gmt":"2009-02-13T15:33:00","slug":"corruption-errors-msg-5242-level-22","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/","title":{"rendered":"Corruption errors: Msg 5242, Level 22"},"content":{"rendered":"<p>\n<font face=\"verdana,geneva\" size=\"2\">In SQL Server 2000 and before, the symptoms of database corruption would occasionally manifest themselves as asserts, such as:<\/font>\n<\/p>\n<blockquote>\n<p>\n\t<font face=\"verdana,geneva\"><font size=\"2\"><font color=\"#ff0000\">SQL Server Assertion: File: &lt;recbase.cpp&gt;, line=1378 Failed Assertion = &#39;m_offBeginVar &lt; m_sizeRec&#39;.<\/font><\/font><\/font>\n\t<\/p>\n<\/blockquote>\n<p><font face=\"verdana,geneva\" size=\"2\">To reduce the number of assertions being fired by the SQL Engine, my team changed these asserts into real error messages for SQL Server 2005 onwards &#8211; either 5242 or 5243 &#8211;&nbsp;such as:<\/font><font size=\"+0\"><\/font><font size=\"+0\"> <\/p>\n<blockquote>\n<p>\n\t<font face=\"verdana,geneva\" size=\"2\" color=\"#ff0000\">Msg 5242, Level 22, State 1, Line 1<\/font>\n\t<\/p>\n<p>\n\t<font face=\"verdana,geneva\" size=\"2\" color=\"#ff0000\">An inconsistency was detected during an internal operation in database &#39;MyCorruptDatabase&#39;(ID:12) on page (1:34923). Please contact technical support. Reference number 4.<\/font>\n\t<\/p>\n<\/blockquote>\n<p><\/font><\/p>\n<p>\n<font size=\"+0\"><font face=\"verdana,geneva\" size=\"2\">Error 5243 is exactly the same except that the database couldn&#39;t be determined for some reason. Both of the errors above say that the offset of the variable length column offset array is beyond the end of the record.<\/font><\/font>\n<\/p>\n<p>\n<font size=\"+0\"><font face=\"verdana,geneva\" size=\"2\">I&#39;ve noticed increasing confusion from these errors being reported &#8211; sometimes the worry is that maintenance jobs are causing them, or DBCC CHECKDB is causing them. This may appear to be so but is really just an artifact of the fact that DBCC CHECKDB reads all allocated pages in the database and may read a corrupt page that your normal queries just don&#39;t happen to cause to be read. The messages may disappear because other maintenance jobs cause indexes to be rebuilt and so corrupt pages may be deallocated from the database &#8211; meaning they won&#39;t be read by DBCC CHECKDB.<\/font><\/font>\n<\/p>\n<p>\n<font size=\"+0\"><font size=\"+0\"><font face=\"verdana,geneva\" size=\"2\">If you have either torn-page detection or page checksums enabled, you may not ever see these 5242 or 5243 errors as you&#39;ll likely see an 824 error instead. The 824 error is raised by the buffer pool when the page is read &#8211; before the page can be processed by the record-cracking code that would raise the 5242 or 5243 errors. Bottom line is that 5242 and 5243 says you&#39;ve got corruption in the structure of a record &#8211; the reference numbers at the end of error say exactly what kind of corruption there is &#8211; for instance that the record size is invalid or the record type is wrong for the type of page it resides. If you see these errors, you need to go through the motions of recovering from corruption and figuring out what&#39;s wrong with your I\/O subsystem. <\/font><\/font><\/font>\n<\/p>\n<p>\n<font size=\"+0\"><font size=\"+0\"><font size=\"2\">Hope this helps.<\/font><\/font><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In SQL Server 2000 and before, the symptoms of database corruption would occasionally manifest themselves as asserts, such as: SQL Server Assertion: File: &lt;recbase.cpp&gt;, line=1378 Failed Assertion = &#39;m_offBeginVar &lt; m_sizeRec&#39;. To reduce the number of assertions being fired by the SQL Engine, my team changed these asserts into real error messages for SQL Server [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,30,31,34,62],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-checkdb-from-every-angle","category-corruption","category-database-maintenance","category-dbcc","category-on-disk-structures"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Corruption errors: Msg 5242, Level 22 - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Corruption errors: Msg 5242, Level 22 - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"In SQL Server 2000 and before, the symptoms of database corruption would occasionally manifest themselves as asserts, such as: SQL Server Assertion: File: &lt;recbase.cpp&gt;, line=1378 Failed Assertion = &#039;m_offBeginVar &lt; m_sizeRec&#039;. To reduce the number of assertions being fired by the SQL Engine, my team changed these asserts into real error messages for SQL Server [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2009-02-13T15:33:00+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/\",\"name\":\"Corruption errors: Msg 5242, Level 22 - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2009-02-13T15:33:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Corruption errors: Msg 5242, Level 22\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Corruption errors: Msg 5242, Level 22 - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/","og_locale":"en_US","og_type":"article","og_title":"Corruption errors: Msg 5242, Level 22 - Paul S. Randal","og_description":"In SQL Server 2000 and before, the symptoms of database corruption would occasionally manifest themselves as asserts, such as: SQL Server Assertion: File: &lt;recbase.cpp&gt;, line=1378 Failed Assertion = &#39;m_offBeginVar &lt; m_sizeRec&#39;. To reduce the number of assertions being fired by the SQL Engine, my team changed these asserts into real error messages for SQL Server [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/","og_site_name":"Paul S. Randal","article_published_time":"2009-02-13T15:33:00+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/","name":"Corruption errors: Msg 5242, Level 22 - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2009-02-13T15:33:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/corruption-errors-msg-5242-level-22\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Corruption errors: Msg 5242, Level 22"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}