<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Updates'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=Updates&amp;orTags=0</link><description>Search results matching tag 'Updates'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Halloween Protection – The Complete Series</title><link>http://sqlblog.com/blogs/paul_white/archive/2013/02/20/halloween-protection-the-complete-series.aspx</link><pubDate>Wed, 20 Feb 2013 23:29:42 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:47843</guid><dc:creator>Paul White</dc:creator><description>&lt;p align="left"&gt;&lt;a href="http://sqlblog.com/blogs/paul_white/image_10B79A4D.png"&gt;&lt;img title="image" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;float:left;padding-top:0px;padding-left:0px;margin:0px 12px 0px 0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="image" align="left" src="http://sqlblog.com/blogs/paul_white/image_thumb_00C85589.png" width="240" height="86" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="left"&gt;&lt;font size="3" face="Calibri"&gt;I have just published a four-part series&lt;/font&gt;&lt;font size="3" face="Calibri"&gt; for &lt;/font&gt;&lt;a href="http://www.sqlperformance.com/" target="_blank"&gt;&lt;font size="3" face="Calibri"&gt;SQLPerformance.com&lt;/font&gt;&lt;/a&gt;&lt;font size="3" face="Calibri"&gt; on the Halloween Problem. Some of you will never have heard of this issue, and those that have might associate it only with T-SQL &lt;code&gt;UPDATE&lt;/code&gt; queries. In fact, the Halloween problem affects execution plans for &lt;code&gt;INSERT, UPDATE, DELETE&lt;/code&gt; and &lt;code&gt;MERGE&lt;/code&gt; statements.&lt;/font&gt;&lt;/p&gt;  &lt;p align="left"&gt;&lt;font size="3" face="Calibri"&gt;This is a topic I have been meaning to write about properly for years, ever since I read Craig Freedman’s 2008 &lt;a href="http://blogs.msdn.com/b/craigfr/archive/2008/02/27/halloween-protection.aspx" target="_blank"&gt;blog post&lt;/a&gt; on the topic, which ended with the cryptic comment:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p align="left"&gt;&lt;font size="3" face="Calibri"&gt;&lt;em&gt;“…although I've used update statements for all of the examples in this post, some insert and delete statements also require Halloween protection, but I'll save that topic for a future post.”&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p align="left"&gt;&lt;font size="3" face="Calibri"&gt;That future post never materialized, sadly, so I thought I would have a go. &lt;/font&gt;&lt;font size="3" face="Calibri"&gt;The four parts of the series are summarized and linked below, I hope you find the material interesting.&lt;/font&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;h3 align="left"&gt;&lt;a href="http://www.sqlperformance.com/2013/02/t-sql-queries/halloween-problem-part-1" target="_blank"&gt;&lt;font face="Calibri"&gt;Part 1 – The Halloween Problem and UPDATE statements&lt;/font&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;The SQL standard and three-phase separation&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Logical update processing&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Pipelined execution&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;The Halloween problem&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Avoiding the problem in UPDATE statements&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h3 align="left"&gt;&lt;a href="http://www.sqlperformance.com/2013/02/t-sql-queries/halloween-problem-part-2" target="_blank"&gt;&lt;font face="Calibri"&gt;Part 2 – The Halloween Problem in INSERT and DELETE queries&lt;/font&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;INSERT examples&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;DELETE examples&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Constraint checking and phase separation&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h3 align="left"&gt;&lt;a href="http://www.sqlperformance.com/2013/02/t-sql-queries/halloween-problem-part-3" target="_blank"&gt;&lt;font face="Calibri"&gt;Part 3 – Halloween Problem optimizations for MERGE&lt;/font&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;MERGE contains several optimizations the other DML statements do not&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Hole-filling with merge join&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Hole-filling with nested loops&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Avoiding an extra B-tree navigation&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Avoiding the join&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h3 align="left"&gt;&lt;a href="http://www.sqlperformance.com/2013/02/t-sql-queries/halloween-problem-part-4" target="_blank"&gt;&lt;font face="Calibri"&gt;Part 4 – The Halloween Problem and the Query Optimizer&lt;/font&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Early optimization approaches&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;The SQL Server optimizer approach&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;The case of the redundant sort&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;HP levels and properties&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Plan changes for Halloween Protection&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Non-spool options&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Row versioning&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;Heaps and forwarded records&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;&lt;font size="3" face="Calibri"&gt;T-SQL functions&lt;/font&gt;&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="left"&gt;&lt;font size="3" face="Calibri"&gt;As always, I appreciate your comments and feedback.&lt;/font&gt;&lt;/p&gt;  &lt;p align="left"&gt;&lt;font size="3" face="Calibri"&gt;Paul White      &lt;br /&gt;&lt;/font&gt;&lt;a href="http://twitter.com/SQL_Kiwi"&gt;&lt;font size="3" face="Calibri"&gt;@SQL_Kiwi&lt;/font&gt;&lt;/a&gt;&lt;font size="3" face="Calibri"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;a href="mailto:SQLkiwi@gmail.com"&gt;&lt;font size="3" face="Calibri"&gt;SQLkiwi@gmail.com&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="left"&gt;&lt;a title="SQL Intersection" href="http://www.sqlintersection.com/" target="_blank"&gt;&lt;img title="Ill_Be_There4" style="border-left-width:0px;border-right-width:0px;background-image:none;border-bottom-width:0px;padding-top:0px;padding-left:0px;margin:0px;display:inline;padding-right:0px;border-top-width:0px;" border="0" alt="Ill_Be_There4" src="http://sqlblog.com/blogs/paul_white/Ill_Be_There4_2D04DC6D.jpg" width="140" height="110" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Deletes that Split Pages and Forwarded Ghosts</title><link>http://sqlblog.com/blogs/paul_white/archive/2012/08/30/deletes-that-split-pages-and-forwarded-ghosts.aspx</link><pubDate>Thu, 30 Aug 2012 16:09:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:44942</guid><dc:creator>Paul White</dc:creator><description>&lt;p align="left"&gt;Can DELETE operations cause pages to split?&amp;#160; Yes.&amp;#160; It sounds counter-intuitive on the face of it; deleting rows frees up space on a page, and page splitting occurs when a page needs additional space.&amp;#160; Nevertheless, there are circumstances when deleting rows causes them to expand before they can be deleted.&amp;#160; The mechanism at work here is &lt;a title="Row Versioning Resource Usage" href="http://msdn.microsoft.com/en-us/library/ms175492(SQL.105).aspx" target="_blank"&gt;row versioning&lt;/a&gt; (extract from Books Online below):&lt;/p&gt;  &lt;p align="left"&gt;&lt;a href="http://sqlblog.com/blogs/paul_white/image_50524A56.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Row versioning space usage" border="0" alt="Row versioning space usage" src="http://sqlblog.com/blogs/paul_white/image_thumb_29A3BE09.png" width="616" height="202" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3 align="left"&gt;Isolation Levels&lt;/h3&gt;  &lt;p align="left"&gt;The relationship between row-versioning isolation levels (the first bullet point) and page splits is reasonably clear.&amp;#160; Any data that existed before either of the isolation levels was enabled will need to have the 14 bytes added by future data modifications, perhaps causing pages to split.&amp;#160; In this scenario, tables will likely contain a mix of records to start with, but over time (particularly as index maintenance is performed) the database will end up with row versions on most records, reducing the chances of a page split for that particular reason.&lt;/p&gt;  &lt;p align="left"&gt;There is nevertheless a window of opportunity where adding the 14 bytes to an existing record could cause a page split.&amp;#160; No doubt there’s a recommendation out there somewhere to rebuild all tables and indexes when enabling or disabling a row-versioning isolation level on a database.&amp;#160; This is not all that interesting though, so let’s look at the second bullet point instead:&lt;/p&gt;  &lt;h3 align="left"&gt;Triggers&lt;/h3&gt;  &lt;p align="left"&gt;The documentation says that versioning information is added if the table has a trigger.&amp;#160; What it doesn’t say is:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="left"&gt;The extra bytes for row versioning can be added &lt;b&gt;even where both READ_COMMITTED_SNAPSHOT and SNAPSHOT isolation are OFF&lt;/b&gt;.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;This &lt;b&gt;only applies to AFTER triggers&lt;/b&gt;, not INSTEAD OF triggers&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;The AFTER trigger also needs to be &lt;b&gt;enabled&lt;/b&gt; to generate row versions, the mere existence of a trigger is not enough.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="left"&gt;There is a very important exception to all the above…&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="left"&gt;SQL Server can still &lt;b&gt;avoid adding the row-versioning information&lt;/b&gt; even where an enabled AFTER TRIGGER exists (the remainder of this post assumes that both row-versioning isolation levels are OFF, by the way).&lt;/p&gt;  &lt;h4 align="left"&gt;Avoiding Row Versioning with Triggers&lt;/h4&gt;  &lt;p align="left"&gt;To explore this behaviour in a bit of detail, we’ll need a test rig:&lt;/p&gt;  &lt;div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;padding-bottom:4px;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;padding-left:4px;width:97.5%;padding-right:4px;font-family:'Courier New', courier, monospace;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;padding-top:4px;" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;USE&lt;/span&gt; tempdb;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;IF&lt;/span&gt;  OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;IS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;NOT&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;DROP&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TABLE&lt;/span&gt; dbo.Test;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Test table&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CREATE&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TABLE&lt;/span&gt; dbo.Test&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;(&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ID          &lt;span style="color:#0000ff;"&gt;integer&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;IDENTITY&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;KEY&lt;/span&gt;,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    Column01    nvarchar(20) &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    Column02    nvarchar(4000) &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Add some rows&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;INSERT dbo.Test &lt;span style="color:#0000ff;"&gt;WITH&lt;/span&gt; (TABLOCKX)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    (Column01)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TOP&lt;/span&gt; (100000)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;CONVERT&lt;/span&gt;(nvarchar(20), N&lt;span style="color:#006080;"&gt;'X'&lt;/span&gt;)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.columns &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; c&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CROSS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.columns &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; c2&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CROSS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.columns &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; c3&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;OPTION&lt;/span&gt; (MAXDOP 1);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- A trigger that does nothing&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CREATE&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TRIGGER&lt;/span&gt; trg&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; dbo.Test&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;AFTER&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;DELETE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;RETURN&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Write any dirty pages to disk&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CHECKPOINT&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Physical storage before any changes&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.index_type_desc,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.alloc_unit_type_desc,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.page_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.record_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.max_record_size_in_bytes&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.dm_db_index_physical_stats(&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    DB_ID(), OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;), &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#006080;"&gt;'DETAILED'&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; ddips&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.index_level = 0;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Buffer pool pages before any changes&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.[file_id],&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_type,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.row_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.free_space_in_bytes,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.is_modified&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.partitions &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; p&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.allocation_units &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; au &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.dm_os_buffer_descriptors &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; dobd &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.allocation_unit_id = au.allocation_unit_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    p.[object_id] = OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;ORDER&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;BY&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SET&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;STATISTICS&lt;/span&gt; IO &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Delete 1 in 10 rows&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;DELETE&lt;/span&gt; dbo.Test&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt; ID % 10 = 0;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SET&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;STATISTICS&lt;/span&gt; IO &lt;span style="color:#0000ff;"&gt;OFF&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    [Page Splits] = COUNT_BIG(*)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.fn_dblog(&lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;,&lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; fd &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    fd.[&lt;span style="color:#0000ff;"&gt;Transaction&lt;/span&gt; Name] = N&lt;span style="color:#006080;"&gt;'SplitPage'&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Ensure ghosted records are processed so&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;--  we see accurate per-page row counts&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;DBCC&lt;/span&gt; FORCEGHOSTCLEANUP;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Physical storage after the delete operation&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.index_type_desc,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.alloc_unit_type_desc,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.page_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.record_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.max_record_size_in_bytes&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.dm_db_index_physical_stats(&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    DB_ID(), OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;), &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#006080;"&gt;'DETAILED'&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; ddips&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.index_level = 0;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Buffer pool pages after the delete operation&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.[file_id],&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_type,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.row_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.free_space_in_bytes,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.is_modified&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.partitions &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; p&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.allocation_units &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; au &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.dm_os_buffer_descriptors &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; dobd &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.allocation_unit_id = au.allocation_unit_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    p.[object_id] = OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;ORDER&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;BY&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;--&lt;span style="color:#0000ff;"&gt;DBCC&lt;/span&gt; TRACEON (3604);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;--&lt;span style="color:#0000ff;"&gt;DBCC&lt;/span&gt; PAGE (tempdb, 1, 4720, 3);&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p align="left"&gt;The script performs the following actions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;div align="left"&gt;Creates a clustered table with an ID and two data columns&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;Adds 100,000 rows each with a single ‘X’ character in the first column, and NULL in the second&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;Creates an AFTER DELETE trigger that does nothing at all except exist and be enabled&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;Displays physical storage and buffer pool information using DMVs &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;Deletes every tenth row in the table&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;Shows the number of leaf-level page splits that occurred &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;Displays the physical storage and buffer pool information again&lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h4 align="left"&gt;Test One – Clustered Table&lt;/h4&gt;

&lt;p align="left"&gt;Typical output:&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://sqlblog.com/blogs/paul_white/image_5337893C.png" target="_blank"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Clustered Table Delete Test 1" border="0" alt="Clustered Table Delete Test 1" src="http://sqlblog.com/blogs/paul_white/image_thumb_37B28739.png" width="660" height="465" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;There are &lt;b&gt;235 data pages&lt;/b&gt; with a maximum physical record size of 17 bytes before &lt;i&gt;and&lt;/i&gt; after the delete.&amp;#160; Before the delete, each data page contains &lt;b&gt;426 rows&lt;/b&gt; with 2 bytes of free space.&amp;#160; After the DELETE:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;div align="left"&gt;A total of 10,000 records have been deleted&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;The data page count remains at 235&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;The maximum record size is still 17 bytes&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;Each data page has lost 42 or 43 rows&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;The free space on each page has risen to 800 or 819 bytes&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;All data pages are marked as being modified in memory&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;A total of 237 logical reads are reported&lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p align="left"&gt;No surprises there.&lt;/p&gt;

&lt;h4 align="left"&gt;Test Two – Clustered Table&lt;/h4&gt;

&lt;p align="left"&gt;Now, run the script again with the &lt;b&gt;only change being that Column01 is defined as nvarchar(22) instead of nvarchar(20)&lt;/b&gt;.&amp;#160; The before picture is the same as before, but the situation after the DELETE is very different:&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://sqlblog.com/blogs/paul_white/image_40DE9CAD.png" target="_blank"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Clustered Table Delete Test 2" border="0" alt="Clustered Table Delete Test 2" src="http://sqlblog.com/blogs/paul_white/image_thumb_3E556AEF.png" width="642" height="242" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;There have been &lt;b&gt;234 page splits&lt;/b&gt;, increasing the data page count from 235 pages to &lt;b&gt;469 pages&lt;/b&gt;, and halving the number of rows on each data page.&amp;#160; The number of reads reported has also blown out from 237 previously to &lt;b&gt;2342 logical reads&lt;/b&gt; in this run (a factor of ten worse).&lt;/p&gt;

&lt;h3 align="left"&gt;Explanation&lt;/h3&gt;

&lt;p align="left"&gt;The cause of the page splitting is that the deleted records must be versioned.&amp;#160; SQL Server 2005 and later uses the version store to build the &lt;i&gt;inserted&lt;/i&gt; and &lt;i&gt;deleted&lt;/i&gt; pseudo-tables used by AFTER triggers.&amp;#160; Where the data has no pre-existing versioning data, adding the 14 bytes will result in a clustered index page split if the page contains insufficient free space to accommodate this expansion.&lt;/p&gt;

&lt;p align="left"&gt;Temporarily turning off ghost record clean-up using global trace flag 661 and examining an affected data page using DBCC PAGE shows the following (&lt;i&gt;remember to turn the trace flag off afterward if you try this&lt;/i&gt;):&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://sqlblog.com/blogs/paul_white/image_739E7D54.png" target="_blank"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Row versioning ghost data record" border="0" alt="Row versioning ghost data record" src="http://sqlblog.com/blogs/paul_white/image_thumb_3F89DE01.png" width="625" height="325" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;Slots 8 and 10 on this page hold records that were unaffected by the DELETE; the physical row length is 17 bytes as displayed previously.&amp;#160; The record that was in slot 9 has been deleted.&amp;#160; It is a ghost record with versioning information added.&amp;#160; The record size is 17 + 14 = 31 bytes, and this expansion with only 2 bytes of free space on the page caused it to split.&lt;/p&gt;

&lt;p align="left"&gt;&lt;b&gt;This explains why the nvarchar(22) DELETE test caused page splitting, but why didn’t the original nvarchar(20) script behave the same?&lt;/b&gt;&lt;/p&gt;

&lt;p align="left"&gt;There is a performance optimization that can avoid adding row versioning information, but only if the table cannot generate ROW_OVERFLOW or LOB allocation units.&amp;#160; This means that the definition of the table must not allow for LOBs or for the possibility of variable length columns moving off row.&amp;#160; The actual size of the data stored is immaterial – &lt;b&gt;it is the potential size that matters&lt;/b&gt;.&lt;/p&gt;

&lt;p align="left"&gt;In our test, the nvarchar(22) column definition caused the maximum possible INROW size to just exceed the 8060 byte limit.&amp;#160; (The exact INROW limit also depends on the table definition; marking one of the data columns SPARSE would reduce the limit to 8015-8019 bytes – whatever the right number is).&lt;/p&gt;

&lt;h3&gt;Heaps of Forwarded Ghosts&lt;/h3&gt;

&lt;p align="left"&gt;&lt;i&gt;“Page splitting only occurs in index structures, are heap structured tables affected by this issue too?”&lt;/i&gt;&lt;/p&gt;

&lt;p align="left"&gt;It is true that &lt;b&gt;heap pages do not split&lt;/b&gt;, but when a heap row needs to expand, the engine will move the row to another page if insufficient free space exists on the current page.&amp;#160; When the storage engine does this, it leaves a &lt;b&gt;forward pointer&lt;/b&gt; behind to avoid updating all non-clustered indexes to reflect the new physical row locator.&lt;/p&gt;

&lt;p align="left"&gt;For a heap table with an active AFTER trigger, and a LOB column (or the possibility of row-overflow) the row has to be &lt;b&gt;versioned and ghosted&lt;/b&gt;.&amp;#160; If the page contains insufficient free space to accommodate the versioning,&amp;#160; the row moves to another page leaving a forwarding stub behind.&amp;#160; This results in a forwarded ghost record.&amp;#160; Ghost clean-up will normally remove this record pretty quickly, so we will need to disable that process temporarily.&amp;#160; The following script creates the &lt;i&gt;very special&lt;/i&gt; circumstances necessary to produce a forwarded ghost record this way (note this script is for test systems only should &lt;b&gt;not&lt;/b&gt; be run in &lt;i&gt;tempdb&lt;/i&gt;):&lt;/p&gt;

&lt;div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;padding-bottom:4px;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;padding-left:4px;width:97.5%;padding-right:4px;font-family:'Courier New', courier, monospace;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;padding-top:4px;" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;USE&lt;/span&gt; Sandpit;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;IF&lt;/span&gt;  OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;IS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;NOT&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;DROP&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TABLE&lt;/span&gt; dbo.Test;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Heap test&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CREATE&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TABLE&lt;/span&gt; dbo.Test&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;(&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ID          &lt;span style="color:#0000ff;"&gt;integer&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;IDENTITY&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;KEY&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;NONCLUSTERED&lt;/span&gt;,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    Column01    nvarchar(16) &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    Column02    nvarchar(4000) &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Add some all-NULL rows&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;INSERT dbo.Test &lt;span style="color:#0000ff;"&gt;WITH&lt;/span&gt; (TABLOCKX)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    (Column01)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TOP&lt;/span&gt; (100000)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.columns &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; c&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CROSS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.columns &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; c2&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CROSS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.columns &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; c3&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;OPTION&lt;/span&gt; (MAXDOP 1);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Ensure rows are tightly packed&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;ALTER&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TABLE&lt;/span&gt; dbo.Test REBUILD;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- A trigger that does nothing&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CREATE&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;TRIGGER&lt;/span&gt; trg&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; dbo.Test&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;AFTER&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;DELETE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;RETURN&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Write any dirty pages to disk&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;CHECKPOINT&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Physical storage before any changes&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.index_type_desc,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.page_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.record_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.max_record_size_in_bytes,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.ghost_record_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.forwarded_record_count&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.dm_db_index_physical_stats(&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    DB_ID(), OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;), &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#006080;"&gt;'DETAILED'&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; ddips&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.alloc_unit_type_desc = N&lt;span style="color:#006080;"&gt;'IN_ROW_DATA'&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;AND&lt;/span&gt; ddips.index_level = 0;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Buffer pool pages before any changes&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.[file_id],&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_type,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.row_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.free_space_in_bytes,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.is_modified&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.partitions &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; p&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.allocation_units &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; au &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.dm_os_buffer_descriptors &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; dobd &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.allocation_unit_id = au.allocation_unit_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    p.[object_id] = OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;AND&lt;/span&gt; dobd.page_type = N&lt;span style="color:#006080;"&gt;'DATA_PAGE'&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;ORDER&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;BY&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Disable ghost clean-up&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;DBCC&lt;/span&gt; TRACEON (661, -1);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SET&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;STATISTICS&lt;/span&gt; IO &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Delete three records on the same page&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;DELETE&lt;/span&gt; dbo.Test&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt; ID &lt;span style="color:#0000ff;"&gt;BETWEEN&lt;/span&gt; 1 &lt;span style="color:#0000ff;"&gt;AND&lt;/span&gt; 3;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SET&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;STATISTICS&lt;/span&gt; IO &lt;span style="color:#0000ff;"&gt;OFF&lt;/span&gt;;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Physical storage after the delete operation&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.index_type_desc,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.page_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.record_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.max_record_size_in_bytes,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.ghost_record_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.forwarded_record_count&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.dm_db_index_physical_stats(&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    DB_ID(), OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;), &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;NULL&lt;/span&gt;, &lt;span style="color:#006080;"&gt;'DETAILED'&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; ddips&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    ddips.alloc_unit_type_desc = N&lt;span style="color:#006080;"&gt;'IN_ROW_DATA'&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;AND&lt;/span&gt; ddips.index_level = 0;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Buffer pool pages after the delete operation&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;SELECT&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.[file_id],&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_type,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.row_count,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.free_space_in_bytes,&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.is_modified&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;FROM&lt;/span&gt; sys.partitions &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; p&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.allocation_units &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; au &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;JOIN&lt;/span&gt; sys.dm_os_buffer_descriptors &lt;span style="color:#0000ff;"&gt;AS&lt;/span&gt; dobd &lt;span style="color:#0000ff;"&gt;ON&lt;/span&gt; &lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.allocation_unit_id = au.allocation_unit_id&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    p.[object_id] = OBJECT_ID(N&lt;span style="color:#006080;"&gt;'dbo.Test'&lt;/span&gt;, N&lt;span style="color:#006080;"&gt;'U'&lt;/span&gt;)&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;AND&lt;/span&gt; dobd.page_type = N&lt;span style="color:#006080;"&gt;'DATA_PAGE'&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    &lt;span style="color:#0000ff;"&gt;AND&lt;/span&gt; dobd.is_modified = 1&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;ORDER&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;BY&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;    dobd.page_id;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;GO&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- View the appropriate page&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;--&lt;span style="color:#0000ff;"&gt;DBCC&lt;/span&gt; TRACEON (3604);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;--&lt;span style="color:#0000ff;"&gt;DBCC&lt;/span&gt; PAGE (0, 1, 339408, 3);&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:#f4f4f4;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#008000;"&gt;-- Enable ghost clean-up&lt;/span&gt;&lt;/pre&gt;


    &lt;pre style="border-bottom-style:none;text-align:left;padding-bottom:0px;line-height:12pt;background-color:white;margin:0em;border-left-style:none;padding-left:0px;width:100%;padding-right:0px;font-family:'Courier New', courier, monospace;direction:ltr;border-top-style:none;color:black;border-right-style:none;font-size:8pt;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;DBCC&lt;/span&gt; TRACEOFF (661, -1);&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p align="left"&gt;Example output, showing page 453648 receiving a versioned forwarded ghost record (click to enlarge in a new tab):&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://sqlblog.com/blogs/paul_white/image_6FD0B2B7.png" target="_blank"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="Versioned Forwarded Ghost Record" border="0" alt="Versioned Forwarded Ghost Record" src="http://sqlblog.com/blogs/paul_white/image_thumb_3F5A2E41.png" width="642" height="262" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;Partial DBCC PAGE output for the highlighted page:&lt;/p&gt;

&lt;p align="left"&gt;&lt;a href="http://sqlblog.com/blogs/paul_white/image_7B564A29.png" target="_blank"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="DBCC PAGE forward ghost record" border="0" alt="DBCC PAGE forward ghost record" src="http://sqlblog.com/blogs/paul_white/image_thumb_6E7BF40B.png" width="668" height="314" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 align="left"&gt;Summary&lt;/h3&gt;

&lt;p align="left"&gt;If you ever wonder why your &lt;a href="http://dba.stackexchange.com/questions/7205/slow-deletion-of-records-when-a-trigger-is-enabled" target="_blank"&gt;deletes are so slow&lt;/a&gt;, it is worth checking to see if you are suffering from page splitting due to an enabled trigger and a table definition that allows for LOB allocations or ROW_OVERFLOW.&amp;#160; Any table with a LOB column (including the max data types) qualifies, as does one with even a surprisingly small number of variable-length columns, as shown in the examples in this post.&amp;#160; This is a great reason to avoid using ‘max’ or old-style LOB data types &lt;i&gt;unnecessarily&lt;/i&gt;, and to be careful about the maximum length of ‘normal’ variable-length data types too.&amp;#160; &lt;b&gt;Remember, it is the potential maximum row size that is important, not the actual row size&lt;/b&gt;.&lt;/p&gt;

&lt;p align="left"&gt;On a related note, remember that deletes on a heap can only deallocate empty pages if a table lock is acquired?&amp;#160; A table definition that allows for LOB or ROW_OVERFLOW &lt;b&gt;prevents that optimization too&lt;/b&gt;.&amp;#160; So, if your heaps are growing despite DELETE WITH (TABLOCKX), check the maximum possible row length!&amp;#160; You could also convert them to clustered tables as well, of course, but that’s a quite different debate.&lt;/p&gt;

&lt;p align="left"&gt;I would like to acknowledge and thank SQL Server MVP &lt;i&gt;Dmitri V. Korotkevitch&lt;/i&gt; who first brought the basic issue to my attention with UPDATE queries.&amp;#160; I would strongly encourage you to also read his &lt;a href="http://aboutsqlserver.com/2012/07/10/cautionary-tale-about-triggers-version-store-and-fragmentation/" target="_blank"&gt;blog entry&lt;/a&gt; showing how &lt;b&gt;this behaviour also affects UPDATE queries&lt;/b&gt;, resulting in slow performance and excessive fragmentation&lt;b&gt;.&lt;/b&gt;&lt;/p&gt;

&lt;p align="left"&gt;Thanks for reading.&lt;/p&gt;

&lt;p align="left"&gt;&lt;a title="Paul White&amp;#39;s Sessions at PASS Summit 2012" href="http://www.sqlpass.org/summit/2012/Sessions/SpeakerDetails.aspx?spid=420" target="_blank"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image45" border="0" alt="image45" src="http://sqlblog.com/blogs/paul_white/image45_33B44B35.png" width="191" height="191" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p align="left"&gt;© 2012 Paul White 
  &lt;br /&gt;Twitter: &lt;a href="http://twitter.com/SQL_Kiwi"&gt;@SQL_Kiwi&lt;/a&gt; 

  &lt;br /&gt;Email: &lt;a href="mailto:SQLkiwi@gmail.com"&gt;SQLkiwi@gmail.com&lt;/a&gt;&lt;/p&gt;</description></item><item><title>How to Install Master Data Services (MDS) Service Pack 1 (for SQL Server 2008 R2)</title><link>http://sqlblog.com/blogs/mds_team/archive/2011/08/16/how-to-install-master-data-services-mds-service-pack-1-for-sql-server-2008-r2.aspx</link><pubDate>Tue, 16 Aug 2011 21:47:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:37859</guid><dc:creator>mattande</dc:creator><description>&lt;p&gt;[This post was created by Jason Howell, Senior Escalation Engineer in the SQL Server Support team specializing in MDS] 
&lt;p&gt;SQL Server 2008 R2 Service pack 1 was released in July 2011, as well as CU#1 for Service Pack 1 a few days afterwards, and CU #2 just yesterday August 15&lt;sup&gt;th&lt;/sup&gt;, 2011. &lt;/p&gt;
 
&lt;p&gt;The purpose of this blog is to call out the difference in finding and running the download specifically for Service Pack 1, since it is packaged and extracted differently that Cumulative Updates. Other than the download &amp;amp; extraction steps, it is pretty much the same process as other Cumulative Updates for MDS. Steps 1 and 3 are the main differences here as compared to this &lt;a href="http://blogs.msdn.com/b/mds/archive/2010/08/25/downloading-and-installing-sql-server-2008-r2-master-data-services-mds-cumulative-updates.aspx"&gt;this prior blog post&lt;/a&gt;.&lt;/p&gt;
 
&lt;p&gt;Installing the &lt;strong&gt;Service Pack 1&lt;/strong&gt; for MDS requires manual intervention in this release, and running the typical Service Pack 1 setup for the other parts of SQL Server itself is not enough to patch MDS databases and websites.&lt;/p&gt;
 
&lt;p&gt;If your server does not have an existing MDS installation, you can install a fresh copy of MDS following these steps in MSDN: &lt;a href="http://msdn.microsoft.com/en-us/library/ee633752.aspx"&gt;Installing and Configuring Master Data Services&lt;/a&gt; You can use the SP1 MSI to install a fresh copy of MDS if needed.&lt;/p&gt;
 
&lt;p&gt;If you already have a copy of MDS up and running, you can patch the existing instance with Service Pack 1 updates. &lt;/p&gt;
 
&lt;p&gt;&lt;strong&gt;Always test &lt;/strong&gt;the update and upgrade process in a non-production environment before applying an update and upgrading the MDS database in your production environment. &lt;/p&gt;
 &lt;h2&gt;1. Download SQL Server 2008 R2 Service Pack 1&lt;/h2&gt; 
&lt;p&gt;The first step is to download the service pack.&lt;/p&gt;
 
&lt;p&gt;You can use this link to download the English version, or change the language as needed. &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=26727"&gt;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=26727&lt;/a&gt;&lt;/p&gt;
 
&lt;p&gt;For example get the file &lt;strong&gt;SQLServer2008R2SP1-KB2528583-x64-ENU.exe&lt;/strong&gt;&lt;/p&gt;
 
&lt;p&gt;However, wait until you have read Step 3 to run the download.&lt;/p&gt;
 &lt;h3&gt;A. It’s worth noting that the MDS Service Pack 1 download package looks different than the CU downloads. &lt;/h3&gt; 
&lt;p&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=26727"&gt;Service Pack 1&lt;/a&gt; does not have a specific MDS download like the CU’s downloads have. Pick the SP1 for x64.&lt;/p&gt;
 
&lt;p&gt;&lt;a href="http://sqlblog.com/blogs/mds_team/clip_image001_7C628982.png"&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image001" border="0" alt="clip_image001" src="http://sqlblog.com/blogs/mds_team/clip_image001_thumb_5FE597A2.png" width="483" height="335"&gt;&lt;/a&gt;&lt;/p&gt;
 
&lt;p&gt;Note: The KB for 2008 R2 Service Pack 1 (KB2528583) is located here: &lt;a href="http://support.microsoft.com/kb/2528583"&gt;http://support.microsoft.com/kb/2528583&lt;/a&gt;&lt;/p&gt;
 &lt;h3&gt;B. What’s in SQL Server 2008 R2 Service Pack 1?&lt;/h3&gt; 
&lt;p&gt;Service Pack 1 includes fixes for SQL Server 2008 R2 &lt;strong&gt;CU1 through CU6&lt;/strong&gt; plus a few other fixes that are not in the RTM CU’s. Read the &lt;a href="http://support.microsoft.com/kb/2528583"&gt;Kb&lt;/a&gt; for an exact list of the additional fixes not in CU1-CU6. &lt;/p&gt;
 
&lt;p&gt;Moving forward, fixes made in the RTM cumulative updates are also ported forward to the next subsequent cumulative update for SP1. However, fixes made to the SP1 cumulative updates will NOT be ported back to the RTM unless there is express need to do so. This makes SP1 updates favorable moving forward to get the most fixes.&lt;/p&gt;
 
&lt;p&gt;The &lt;font color="#008080"&gt;green&lt;/font&gt; cumulative updates for MDS are included in Service Pack 1. The &lt;font color="#ff8000"&gt;orange &lt;/font&gt;items below are carried forward in CU#1 for SP1. To get the latest updates, then use SP1 CU2 instead of SP1 itself. The list grows every 2 months, so refer to this &lt;a href="http://support.microsoft.com/kb/2567616"&gt;list&lt;/a&gt; if in doubt which one is latest.&lt;/p&gt;
 
&lt;ul&gt; 
&lt;li&gt;RTM &amp;amp; Updates  
&lt;ul&gt; 
&lt;li&gt;10.50.1600.1 Release to Manufacturer – May 10, 2010  
&lt;li&gt;10.50.1617.0 RTM Security Patch MS11-049 (&lt;a href="http://support.microsoft.com/kb/2494088"&gt;2494088&lt;/a&gt;) June 14, 2011  
&lt;li&gt;&lt;font color="#008080"&gt;10.50.1702.0 RTM CU #1 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/981355"&gt;&lt;font color="#008080"&gt;981355&lt;/font&gt;&lt;/a&gt;&lt;font color="#008080"&gt;) May 18, 2010 &lt;/font&gt; 
&lt;li&gt;&lt;font color="#008080"&gt;10.50.1720.0 RTM CU #2 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2072493"&gt;&lt;font color="#008080"&gt;2072493&lt;/font&gt;&lt;/a&gt;&lt;font color="#008080"&gt;) June 21, 2010 &lt;/font&gt; 
&lt;li&gt;&lt;font color="#008080"&gt;10.50.1734.0 RTM CU #3 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2261464"&gt;&lt;font color="#008080"&gt;2261464&lt;/font&gt;&lt;/a&gt;&lt;font color="#008080"&gt;) Aug 16, 2010 &lt;/font&gt; 
&lt;li&gt;&lt;font color="#008080"&gt;10.50.1746.0 RTM CU #4 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2345451"&gt;&lt;font color="#008080"&gt;2345451&lt;/font&gt;&lt;/a&gt;&lt;font color="#008080"&gt;) Oct 18, 2010 &lt;/font&gt; 
&lt;li&gt;&lt;font color="#008080"&gt;10.50.1753.0 RTM CU #5 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2438347"&gt;&lt;font color="#008080"&gt;2438347&lt;/font&gt;&lt;/a&gt;&lt;font color="#008080"&gt;) Dec 20, 2010 &lt;/font&gt; 
&lt;li&gt;&lt;font color="#008080"&gt;10.50.1765.0 RTM CU #6 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2489376"&gt;&lt;font color="#008080"&gt;2489376&lt;/font&gt;&lt;/a&gt;&lt;font color="#008080"&gt;) Feb 21, 2011&lt;/font&gt;  
&lt;li&gt;&lt;font color="#ff8000"&gt;10.50.1777.0 RTM CU #7 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2507770"&gt;&lt;font color="#ff8000"&gt;2507770&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff8000"&gt;) Apr 18, 2011 &lt;/font&gt; 
&lt;li&gt;&lt;font color="#ff8000"&gt;10.50.1790.0 RTM CU Security Patch MS11-049 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2494086"&gt;&lt;font color="#ff8000"&gt;2494086&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff8000"&gt;) June 14, 2011 &lt;/font&gt; 
&lt;li&gt;&lt;font color="#ff8000"&gt;10.50.1797.0 RTM CU #8 (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/2534352"&gt;&lt;font color="#ff8000"&gt;2534352&lt;/font&gt;&lt;/a&gt;&lt;font color="#ff8000"&gt;) June 20, 2011&lt;/font&gt;  
&lt;li&gt;10.50.1804.0 RTM CU #9 (&lt;a href="http://support.microsoft.com/kb/2567713"&gt;2567713&lt;/a&gt;) Aug 15, 2011  
&lt;li&gt;etc… &lt;/li&gt;
&lt;/ul&gt;
 
&lt;li&gt;SERVICE PACK 1 &amp;amp; Updates  
&lt;ul&gt; 
&lt;li&gt;10.50.2500.0 &lt;strong&gt;SP1 Release to Web&lt;/strong&gt; (&lt;a href="http://support.microsoft.com/kb/2528583"&gt;2528583&lt;/a&gt;) July 13, 2011 (&lt;font color="#008080"&gt;contains RTM CU6 + others&lt;/font&gt;)  
&lt;li&gt;10.50.2769.0 SP1 CU #1 (&lt;a href="http://support.microsoft.com/kb/2544793"&gt;2544793&lt;/a&gt;) July 18, 2011 (&lt;font color="#ff8000"&gt;contains RTM CU7 - RTM CU8&lt;/font&gt;)  
&lt;li&gt;10.50.2772.0 SP1 CU #2 (&lt;a href="http://support.microsoft.com/kb/2567714"&gt;2567714&lt;/a&gt;) Aug 15, 2011  
&lt;li&gt;etc… &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
 &lt;h3&gt;C. Instead of SP1 itself, you can alternately download CU2 (or later) for Service Pack 1&lt;/h3&gt; 
&lt;p&gt;Instead of SP1 itself, you could run CU1 or CU2 (or later CU) for SP1 if you have business requirements to do so. There is a specific MDS file available for download for each CU, which contains only the piece to patch Master Data Services. &lt;/p&gt;
 
&lt;p&gt;Since the MDS download contains a *.msi, it is unlike the rest of SQL feature area CU’s which use *.msp patches that require SP1 as a prerequisite to installing. Therefore you could use the SP1 CU2 file for a fresh install of MDS. &lt;/p&gt;
 
&lt;ul&gt; 
&lt;li&gt;Cumulative Update 1 for SP1: &lt;a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2544793&amp;amp;kbln=en-us"&gt;http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2544793&amp;amp;kbln=en-us&lt;/a&gt;  
&lt;li&gt;Cumulative Update 2 for SP1: &lt;a href="http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2567714&amp;amp;kbln=en-us"&gt;http://support.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2567714&amp;amp;kbln=en-us&lt;/a&gt;  
&lt;li&gt;Future SP1 updates will be linked from this article: &lt;a href="http://support.microsoft.com/kb/2567616"&gt;http://support.microsoft.com/kb/2567616&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
 
&lt;p&gt;&lt;b&gt;&lt;a href="http://sqlblog.com/blogs/mds_team/clip_image003_3B540A1E.jpg"&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image003" border="0" alt="clip_image003" src="http://sqlblog.com/blogs/mds_team/clip_image003_thumb_0CFA8471.jpg" width="752" height="157"&gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
 
&lt;p&gt;When you fill out the request page, as shown above the hotfix website will send you an email with the link to download the CU update. &lt;/p&gt;
 &lt;h2&gt;2. MDS Preparations – stop current activity, backup your MDS Database, check the starting version&lt;/h2&gt; 
&lt;p&gt;The upgrade process is two-fold: First, Upgrade the binaries. Secondly, upgrade the database schema&lt;/p&gt;
 
&lt;p&gt;Therefore, before we begin, let’s stop all current activity so that we have a clean and safe copy of the MDS database in a consistent state, and make a backup of the MDS database and transaction log to be sure we have a safe copy just in case.&lt;/p&gt;
 &lt;h3&gt;A. Stop the IIS web site or application pool.&lt;/h3&gt; 
&lt;p&gt;This will keep users out of the system while we do the upgrade maintenance. You may want to alert the MDS users about the scheduled maintenance according to your businesses' change control processes. &lt;/p&gt;
 
&lt;p&gt;Open Internet Information Services (IIS) Manager and stop the Master Data Manager Web application and the MDS Web service (if enabled). You can do this either by stopping the application pool that contains the Web application and service, or you can stop the Web site that contains them. If you stop the application pool, you stop requests for all applications in that application pool. If you stop the Web site, you stop only traffic to the Web site and any applications and services it contains.&lt;/p&gt;
 
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5775.image_5F00_0F57BF27.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image004" border="0" alt="clip_image004" src="http://sqlblog.com/blogs/mds_team/clip_image004_0C8E517C.png" width="307" height="315"&gt;&lt;/b&gt;&lt;/a&gt;OR &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5466.image_5F00_743EF018.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image005" border="0" alt="clip_image005" src="http://sqlblog.com/blogs/mds_team/clip_image005_251DEECC.png" width="216" height="318"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
 &lt;h3&gt;B. Stop any query or maintenance operations&lt;/h3&gt; 
&lt;p&gt;Such as scheduled jobs, reports, or custom applications that interact with the MDS database directly. &lt;/p&gt;
 
&lt;p&gt;You could stop your SQL Agent service temporarily if unsure about scheduled jobs that might affect MDS data.&lt;/p&gt;
 &lt;h3&gt;C. Backup the MDS database and the transaction log&lt;/h3&gt; 
&lt;p&gt;You get to pick the name of your MDS database when you originally set it up with the Configuration Manager, so your database name may vary. &lt;/p&gt;
 
&lt;p&gt;If you use FULL recovery model on the MDS database, you can back up the transaction LOG also.&lt;/p&gt;
 
&lt;p&gt;Use a TSQL query or SSMS backup as you please.&lt;/p&gt;

&lt;pre&gt;BACKUP DATABASE MDS TO DISK='C:\mybackups\mds_before_sp1.bak'&lt;/pre&gt;
&lt;pre&gt;BACKUP LOG MDS TO DISK='C:\mybackups\mds_log_before_sp1.trn'&lt;/pre&gt;
&lt;pre&gt;Object Explorer in SQL Server Management Studio:&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5270.image_5F00_32580ACA.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image006" border="0" alt="clip_image006" src="http://sqlblog.com/blogs/mds_team/clip_image006_3DAD8C1C.png" width="367" height="257"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;D. Query mdm.tblSystem in the current MDS database. &lt;/h3&gt;
&lt;p&gt;Review value for SchemaVersion and note the value, so you can compare the value after you apply the MDS update to verify that the value has been increased. The SchemaVersion may vary based on the build you are starting with. Some MDS Patches do no schema upgrades, but some do. Depending on which version you start from, Service Pack 1 may or may not upgrade the schema.&lt;/p&gt;

&lt;p&gt;&lt;span class="kwrd"&gt;USE&lt;/span&gt; MDS&lt;br&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; * &lt;span class="kwrd"&gt;FROM&lt;/span&gt; mdm.tblSystem&lt;/p&gt;

&lt;h2&gt;3. Run the Service Pack 1 executable and msi’s&lt;/h2&gt;
&lt;p&gt;The SP1 download &lt;strong&gt;SQLServer2008R2SP1-KB2528583-x64-ENU.exe&lt;/strong&gt; is a self-extracting zip. You can run SP1 for all of SQL if you want (see step 3A) or manually extract just the Master Data Services *.msi if needed (see step 3B). &lt;/p&gt;

&lt;p&gt;Double-clicking the .exe extracts SP1 to a temp folder on the root of the drive&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0412.image_5F00_50C24BB3.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image007" border="0" alt="clip_image007" src="http://sqlblog.com/blogs/mds_team/clip_image007_2AF89265.png" width="410" height="153"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After extracting, it will prompt you with security UAC to run the service pack 1 setup.&lt;/p&gt;
&lt;h3&gt;A. Option 1: Run SP1 for all SQL Server feature areas first, then find the MDS msi.&lt;/h3&gt;
&lt;p&gt;If you need to patch all of the features of your SQL Server with Service Pack 1, follow the normal steps in the GUI. &lt;/p&gt;

&lt;p&gt;Running SP1 will extract the MasterDataServices.msi file but it will not run it automatically.&lt;/p&gt;

&lt;p&gt;After you have finished patching SQL Server 2008 R2 with Service Pack 1, you can then find the MSI for MDS in the setup bootstrap folder. It’s kept here for caching purposes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Update Cache\KB2528583\ServicePack\1033_enu_lp\x64\setup\ masterdataservices.msi&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On my computer it is in this folder, but I imagine the language (1033=English) may vary based on which SQL locale you have used in the installation. &lt;/p&gt;

&lt;p&gt;Within that folder, click the MSI to run the MDS SP1 setup &lt;strong&gt;masterdataservices.msi&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;B. Option 2: Manually Extract SP1 if you do not need to patch any other parts of SQL.&lt;/h3&gt;
&lt;p&gt;If you don’t need to patch the other features of SQL Server, or maybe you need to just patch MDS as a separate step, you can manually extract the Service Pack 1 and get to the MSI. Several 3rd party compression tools let you right click on the .exe and extract it to a folder of your choosing as well.&lt;/p&gt;

&lt;p&gt;From a command line, you can run:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQLServer2008R2SP1-KB2528583-x64-ENU.exe /extract&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0511.image_5F00_041E0F10.png"&gt;&lt;b&gt;&lt;img style="border:0px currentColor;display:inline;" title="clip_image008" border="0" alt="clip_image008" src="http://sqlblog.com/blogs/mds_team/clip_image008_5879B228.png" width="585" height="297"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2063.image_5F00_0CBE679C.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image009" border="0" alt="clip_image009" src="http://sqlblog.com/blogs/mds_team/clip_image009_2300F003.png" width="234" height="179"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Find the MDS msi in the specified location, in the subfolder: &lt;br&gt;&lt;strong&gt;&amp;lt;Extracted folder&amp;gt;\1033_enu_lp\x64\setup\masterdataservices.msi&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0027.image_5F00_076F80EB.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image010" border="0" alt="clip_image010" src="http://sqlblog.com/blogs/mds_team/clip_image010_0998ECC9.png" width="573" height="271"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;4. Run the &lt;strong&gt;masterdataservices.msi &lt;/strong&gt;manually (like any other MDS update) &lt;/h2&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7041.image_5F00_08F09CFF.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image011" border="0" alt="clip_image011" src="http://sqlblog.com/blogs/mds_team/clip_image011_020D7D5C.png" width="394" height="196"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1581.image_5F00_554830A0.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image012" border="0" alt="clip_image012" src="http://sqlblog.com/blogs/mds_team/clip_image012_1692CCDA.png" width="303" height="232"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run through the installation until it completes&lt;/p&gt;

&lt;p&gt;.&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3731.image_5F00_6507C5A4.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image013" border="0" alt="clip_image013" src="http://sqlblog.com/blogs/mds_team/clip_image013_481E3A6F.png" width="313" height="240"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: If you start the MDS website at this point and visit it, you may get a version incompatible error. This is expected behavior when the schema version increases because the MDS binaries are upgraded, but the database is not yet upgraded. Users cannot use MDS yet if you see this message.&lt;/p&gt;

&lt;p&gt;Client Version: 10.51.2500.0 &lt;br&gt;Database Version: 1.0.0.0 &lt;br&gt;&lt;font color="#ff0000"&gt;The Client version is incompatible with the Database version. Please ask your administrator to upgrade the Client components or the Database components or both.&lt;/font&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5226.image_5F00_70BD0CD6.png"&gt;&lt;b&gt;&lt;img style="border:0px currentColor;display:inline;" title="clip_image014" border="0" alt="clip_image014" src="http://sqlblog.com/blogs/mds_team/clip_image014_60ADD7BF.png" width="474" height="208"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note the binaries and scripts are upgraded already to 10.50.2500.0 (the build number of R2 Service Pack 1)&lt;/p&gt;

&lt;p&gt;Binaries are the *.exe or *.dll in the Master Data Services installation folders such as &lt;/p&gt;

&lt;p&gt;C:\Program Files\Microsoft SQL Server\Master Data Services\Configuration\&lt;/p&gt;

&lt;p&gt;C:\Program Files\Microsoft SQL Server\Master Data Services\WebApplication\bin&lt;/p&gt;

&lt;p&gt;When you right click on them in Windows Explorer, and view the properties, you can check the file version:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2260.image_5F00_762B7D7A.png"&gt;&lt;b&gt;&lt;img style="border:0px currentColor;display:inline;" title="clip_image015" border="0" alt="clip_image015" src="http://sqlblog.com/blogs/mds_team/clip_image015_6041A4CA.png" width="376" height="477"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;5. The Master Data Services Configuration Manager may need to run to complete the MDS database schema upgrade.&lt;/h2&gt;
&lt;h3&gt;A. Run Configuration Manager &lt;/h3&gt;
&lt;p&gt;It will try to run &lt;strong&gt;automatically&lt;/strong&gt; after the setup completes, or you can run it later from the start menu. Complete the additional steps therein to upgrade your MDS Database and your MDS Websites. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3568.image_5F00_663C38B6.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image016" border="0" alt="clip_image016" src="http://sqlblog.com/blogs/mds_team/clip_image016_54ABE78B.png" width="244" height="217"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;B. Connect and select your database&lt;/h3&gt;
&lt;p&gt;In the MDS Configuration Manager, click the &lt;strong&gt;[Select Database…]&lt;/strong&gt; button. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get connected&lt;/strong&gt; to your MDS database on whichever SQL Server it may reside on. Note if you utilize a named instance, you have to manually type in the servername\instancename because the configuration manager forgets which instance to connect to every time.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6215.image_5F00_24C1865D.png"&gt;&lt;b&gt;&lt;img style="border:0px currentColor;display:inline;" title="clip_image017" border="0" alt="clip_image017" src="http://sqlblog.com/blogs/mds_team/clip_image017_3F4E3223.png" width="398" height="313"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;C. Upgrade your MDS database if needed&lt;/h3&gt;
&lt;p&gt;If you see the below red error text &lt;font color="#ff0000"&gt;"This database requires an upgrade. You cannot change system settings until the database is upgraded" &lt;/font&gt;then you need to upgrade your MDS database.&lt;/p&gt;&lt;p&gt;Sometimes you do not see this text, if you already had the schema upgrades are already in place from a prior cumulative update patch, then no further action is required, skip to step 6.&lt;/p&gt;

&lt;p&gt;If you get the error after you picked the database server and the existing database name, in the MDS Configuration Manager, use the &lt;strong&gt;[Upgrade Database…]&lt;/strong&gt; button to upgrade the database.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1018.image_5F00_78385676.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image018" border="0" alt="clip_image018" src="http://sqlblog.com/blogs/mds_team/clip_image018_53D381A1.png" width="564" height="174"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;D. Click through the Upgrade Database Wizard &lt;/h3&gt;
&lt;p&gt;When you run the Upgrade, you will see several screens in the upgrade wizard. It will show which schema upgrades need to happen. It’s easy, so I’ll just show the progress bar:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4251.image_5F00_68B544A7.png"&gt;&lt;b&gt;&lt;img style="border:0px currentColor;display:inline;" title="clip_image019" border="0" alt="clip_image019" src="http://sqlblog.com/blogs/mds_team/clip_image019_2579FBF4.png" width="503" height="370"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;E. Now check the database SchemaVersion in your MDS database by running the query to confirm the schema is now upgraded.&lt;/h3&gt;
&lt;p&gt;I expect &lt;strong&gt;1.0.7.0 &lt;/strong&gt;for Service Pack 1.&lt;/p&gt;

&lt;p&gt;&lt;span class="kwrd"&gt;USE&lt;/span&gt; MDS&lt;br&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; * &lt;span class="kwrd"&gt;FROM&lt;/span&gt; mdm.tblSystem&lt;/p&gt;


&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2526.image_5F00_5564683B.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image022" border="0" alt="clip_image022" src="http://sqlblog.com/blogs/mds_team/clip_image022_52FB1BB7.png" width="620" height="99"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;6. Start the MDS website and Application Pool and make sure it works.&lt;/h2&gt;
&lt;h3&gt;A. Start the web site and application pools&lt;/h3&gt;
&lt;p&gt;After the database upgrade is complete, your users can start using the MDS website again. Start the Website and or Application Pools, and remember to enable any SQL Agent jobs or other maintenance you may have disabled for the upgrade timeframe.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5635.image_5F00_7F941623.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image020" border="0" alt="clip_image020" src="http://sqlblog.com/blogs/mds_team/clip_image020_24A1960A.png" width="336" height="328"&gt;&lt;/b&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6724.image_5F00_7DE34A4F.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image021" border="0" alt="clip_image021" src="http://sqlblog.com/blogs/mds_team/clip_image021_562D039F.png" width="333" height="336"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;B. Browse through your MDS website to make sure the models are present, and that things seem normal.&lt;/h3&gt;
&lt;p&gt;You can get IIS to help you if you forgot the URL:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2526.image_5F00_3404C29F.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image023" border="0" alt="clip_image023" src="http://sqlblog.com/blogs/mds_team/clip_image023_03AE2363.png" width="440" height="291"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can confirm the version number in the Help menu (blue question mark on the upper right of on the web page). &lt;/p&gt;

&lt;p&gt;The MDS website shows the version as &lt;strong&gt;10.51.2500.0&lt;/strong&gt; for Service Pack 1.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7713.image_5F00_598E4000.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image024" border="0" alt="clip_image024" src="http://sqlblog.com/blogs/mds_team/clip_image024_353990F8.png" width="348" height="243"&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6330.image_5F00_382E9A64.png"&gt;&lt;b&gt;&lt;img style="border-width:0px;display:inline;" title="clip_image025" border="0" alt="clip_image025" src="http://sqlblog.com/blogs/mds_team/clip_image025_62BAB0BB.png" width="351" height="374"&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>SQL Server 2005 SP4 is here!</title><link>http://sqlblog.com/blogs/aaron_bertrand/archive/2010/12/17/sql-server-2005-sp4-is-here.aspx</link><pubDate>Sat, 18 Dec 2010 03:59:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:31382</guid><dc:creator>AaronBertrand</dc:creator><description>&lt;p&gt;Yes, the day has finally arrived, and a couple of weeks ahead of schedule.&amp;nbsp; Typically when Microsoft promises a release in Qx or Hx, the software comes on the last or second last day of that quarter or half.&amp;nbsp; This year, we get an early Christmas present: SQL Server 2005 SP4.&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;b&gt;&lt;font size="4"&gt;Downloads&lt;/font&gt;&lt;/b&gt; &lt;br&gt;&lt;/p&gt;

&lt;p&gt;To download SP4, go to this link:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b953e84f-9307-405e-bceb-47bd345baece" title="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b953e84f-9307-405e-bceb-47bd345baece" target="_blank"&gt;http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b953e84f-9307-405e-bceb-47bd345baece&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are looking for the Express versions of SP4, you can get Express, Express with Tools, and Express with Advanced Services at the following URL (though they don't really do a great job of describing which file(s) may be most appropriate for you):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=26435597-b28e-4568-9d16-017bdf47abdc" title="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=26435597-b28e-4568-9d16-017bdf47abdc" target="_blank"&gt;http://www.microsoft.com/downloads/en/details.aspx?FamilyID=26435597-b28e-4568-9d16-017bdf47abdc&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want Express that can install on 32-bit or 64-bit systems, download SQLEXPR.EXE.&amp;nbsp; If you know you will only install to 32-bit systems, download the smaller SQLEXPR32.EXE.&amp;nbsp; (The only difference is the size of the package - I can hear the peanut gallery now.&amp;nbsp; In all seriousness, there is no such thing as a 64-bit version of SQL Server Express for SQL Server 2005 - that option first arrived with SQL Server 2008.)&amp;nbsp; If you want Express with Tools, use SQLEXPR_TOOLKIT.EXE, and if you want Express with Advanced Services, use SQLEXPR_ADV.EXE. &lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;b&gt;&lt;font size="4"&gt;Fixes&lt;/font&gt;&lt;/b&gt; &lt;br&gt;&lt;/p&gt;&lt;p&gt;To review the fixes in SP4, see the following Knowledge Base article:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2463332" title="http://support.microsoft.com/kb/2463332" target="_blank"&gt;http://support.microsoft.com/kb/2463332&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I am not sure why the list is so short - SP4 does contain all of the fixes in Cumulative Updates 1 through 11 for Service Pack 3, and there are definitely more than that handful.&amp;nbsp; I think this makes the service pack look a lot less useful than it actually is, especially for people who are still on SP3 or its earlier cumulative updates.&amp;nbsp; Here is the full list of 11 cumulative updates, to make it a little easier to generate the full list of fixes or to find a particular fix you want to make sure is included in the service pack (see below for information about fixes in CU #12):&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2258854" title="http://support.microsoft.com/kb/2258854" target="_blank"&gt;CU #11 (9.00.4309 - 2010-08-16) : KB #2258854&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/983329" title="http://support.microsoft.com/kb/983329" target="_blank"&gt;CU #10 (9.00.4305 - 2010-06-21) : KB #983329&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/980176" title="http://support.microsoft.com/kb/980176" target="_blank"&gt;CU #9 &amp;nbsp; (9.00.4294 - 2010-04-19) : KB #980176&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/978915" title="http://support.microsoft.com/kb/978915" target="_blank"&gt;CU #8 &amp;nbsp; (9.00.4285 - 2010-02-15) : KB #978915&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/976951" title="http://support.microsoft.com/kb/976951" target="_blank"&gt;CU #7 &amp;nbsp; (9.00.4273 - 2009-12-21) : KB #976951&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/974648" title="http://support.microsoft.com/kb/974648" target="_blank"&gt;CU #6 &amp;nbsp; (9.00.4266 - 2009-10-19) : KB #974648&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/972511" title="http://support.microsoft.com/kb/972511" target="_blank"&gt;CU #5 &amp;nbsp; (9.00.4230 - 2009-08-17) : KB #972511&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/970279" title="http://support.microsoft.com/kb/970279" target="_blank"&gt;CU #4 &amp;nbsp; (9.00.4226 - 2009-06-15) : KB #970279&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/967909" title="http://support.microsoft.com/kb/967909" target="_blank"&gt;CU #3 &amp;nbsp; (9.00.4220 - 2009-04-20) : KB #967909&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/961930" title="http://support.microsoft.com/kb/961930" target="_blank"&gt;CU #2 &amp;nbsp; (9.00.4211 - 2009-02-16) : KB #961930&lt;/a&gt;&lt;br&gt;&lt;a href="http://support.microsoft.com/kb/959195" title="http://support.microsoft.com/kb/959195" target="_blank"&gt;CU #1 &amp;nbsp; (9.00.4207 - 2008-12-19) : KB #959195&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Most importantly (at least IMHO), this service pack finally addresses the MSXML6 issues that have plagued Windows XP SP3 users since at least &lt;a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2009/02/20/the-xp-sp3-msxml6-sp2-sql-server-debacle.aspx" title="http://sqlblog.com/blogs/aaron_bertrand/archive/2009/02/20/the-xp-sp3-msxml6-sp2-sql-server-debacle.aspx" target="_blank"&gt;February of 2009&lt;/a&gt;.&amp;nbsp; From the fix list:&lt;/p&gt;

&lt;blockquote&gt;
&lt;table bgcolor="#ffffdd" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;div style="padding:10px 20px;background:none repeat scroll 0% 0% transparent;font-size:13px;font-family:georgia,times new roman,times;-moz-background-inline-policy:continuous;"&gt;&lt;i&gt;When SQL Server 2005 SP3 is applied on a machine that has a later version of MSXML6 installed, the service pack setup fails. This issue occurs when you upgrade Windows XP SP2 to Windows XP SP3 and then apply SQL Server 2005 SP3. To fix this issue, apply SQL Server 2005 SP4.&lt;/i&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/blockquote&gt;


&lt;p&gt;&lt;br&gt;&lt;font size="4"&gt;&lt;b&gt;Build Number&lt;/b&gt;&lt;/font&gt; &lt;br&gt;&lt;/p&gt;&lt;p&gt;The build number for SP4 is 9.00.5000.&amp;nbsp; (This "round number" build is becoming a favorite practice not just within the SQL Server team but across a lot of other Microsoft divisions as well.)&amp;nbsp; Here is the result of "SELECT @@VERSION;" on my local Express instances, just for fun (notice that even though I am running x64 there is nothing in there that tells you whether the operating system is 32-bit or 64-bit):&lt;/p&gt;
&lt;blockquote&gt;
&lt;table bgcolor="#eeeeee" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre style="padding:10px 20px;font-size:12px;font-family:consolas,lucida console,courier new,courier;-moz-background-inline-policy:continuous;"&gt;Microsoft SQL Server 2005 - 9.00.5000.00 (Intel X86) &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dec 10 2010 10:56:29 &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Copyright (c) 1988-2005 Microsoft Corporation&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Express Edition on Windows NT 6.1 (Build 7600: )&lt;br&gt;&lt;br&gt;Microsoft SQL Server 2005 - 9.00.5000.00 (Intel X86) &lt;br&gt;    Dec 10 2010 10:56:29 &lt;br&gt;    Copyright (c) 1988-2005 Microsoft Corporation&lt;br&gt;    Express Edition with Advanced Services on Windows NT 6.1 (Build 7600: ) &lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;br&gt;&lt;font size="4"&gt;&lt;b&gt;Should you update?&lt;/b&gt;&lt;/font&gt; &lt;br&gt;&lt;/p&gt;&lt;p&gt;You will still need to wait one Cumulative Update (CU) cycle to restore all of the fixes from &lt;a href="http://support.microsoft.com/kb/2345449" title="http://support.microsoft.com/kb/2345449" target="_blank"&gt;SP3 CU #12&lt;/a&gt;.&amp;nbsp; As with previous SP releases in the 2008 branches, if you've already applied CU #12 to your SQL Server 2005 SP3 instance (SELECT @@VERSION will show 9.00.4311 or greater, but less than 9.00.4912 - the build for the &lt;a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2010/11/04/sql-server-2005-sp4-ctp-is-available-for-download.aspx" title="http://sqlblog.com/blogs/aaron_bertrand/archive/2010/11/04/sql-server-2005-sp4-ctp-is-available-for-download.aspx" target="_blank"&gt;Service Pack 4 CTP&lt;/a&gt;), and you are relying on fixes in that build, you should hold off on SP4 until the first CU for SP4 is released.&amp;nbsp; Usually this occurs within about a month of the service pack, but given the holidays, at this point I would expect it mid-February.&lt;br&gt;&lt;/p&gt;

&lt;p&gt;This will almost certainly be the last service pack for SQL Server 2005 - from this point forward all you're likely to see are cumulative updates to the SP3 and SP4 branches and, roughly a year from today, mainstream support will only need to maintain the SP4 branch.&amp;nbsp; You can read more about this in the following blog post from the CSS blog:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/psssql/archive/2010/02/17/mainstream-vs-extended-support-and-sql-server-2005-sp4-can-someone-explain-all-of-this.aspx" title="http://blogs.msdn.com/b/psssql/archive/2010/02/17/mainstream-vs-extended-support-and-sql-server-2005-sp4-can-someone-explain-all-of-this.aspx" target="_blank"&gt;Mainstream vs Extended Support and SQL Server 2005 SP4: Can someone explain all of this?&lt;/a&gt; &lt;br&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Downloading and Installing SQL Server 2008 R2 Master Data Services (MDS) Cumulative Updates</title><link>http://sqlblog.com/blogs/mds_team/archive/2010/08/25/downloading-and-installing-sql-server-2008-r2-master-data-services-mds-cumulative-updates.aspx</link><pubDate>Thu, 26 Aug 2010 00:13:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:28281</guid><dc:creator>mattande</dc:creator><description>&lt;p&gt;(This post was contributed by Reagan Templin, Lead Technical Writer for the MDS Team)&lt;/p&gt;&lt;p&gt;Note: This article is applicable to Microsoft SQL Server 2008 R2 Master Data Services feature. SQL Server 2012 now ships Master Data Services on the DVD with the other SQL Server 2012 features and is patched by the same Cumulative Updates and Service Packs for SQL Server 2012 and the downloads are no longer specific to MDS for separate download .&lt;/p&gt;  &lt;p&gt;Recently, we released &lt;a href="http://sqlblog.com/blogs/mds_team/archive/2010/06/28/master-data-services-first-cumulative-update-is-now-available.aspx" target="_blank"&gt;the first cumulative update (CU) for Master Data Services (MDS)&lt;/a&gt;. This blog entry explains how to download and install that CU, as well as subsequent CUs for MDS.&lt;/p&gt;  &lt;p&gt;Each Master Data Services (MDS) cumulative update is released as a stand-alone installer for SQL Server 2008 R2 Master Data Services. An update can be installed on a server without a previous installation of MDS, or it can be applied over an existing RTM installation or previously updated installation of MDS.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Note&lt;/b&gt; MDS is a feature of the versions and editions of SQL Server listed in &lt;a href="http://msdn.microsoft.com/library/ee633742(SQL.105).aspx" target="_blank"&gt;Setup Requirements (Master Data Services)&lt;/a&gt; in SQL Server Books Online (BOL). Any computer where you install MDS must be licensed accordingly. For more information, refer to the End User License Agreement (EULA).&lt;/p&gt; &lt;/blockquote&gt;  &lt;h2&gt;To download an MDS Update:&lt;/h2&gt;  &lt;ol&gt;   &lt;li&gt;At the top of the Knowledge Base page for the download, click &lt;b&gt;View and request hotfix downloads&lt;/b&gt;.&lt;/li&gt;    &lt;li&gt;Read the terms of the agreement and click &lt;b&gt;I Agree&lt;/b&gt; if you agree and want to continue.&lt;/li&gt;    &lt;li&gt;On the &lt;b&gt;Hotfix Request&lt;/b&gt; page, select the necessary file to obtain this update.&lt;/li&gt;    &lt;li&gt;Specify an e-mail address to e-mail this update to, and type the characters in the picture. Then click &lt;b&gt;Request hotfix&lt;/b&gt;.&lt;/li&gt;    &lt;li&gt;On the &lt;b&gt;Hotfix Confirmation&lt;/b&gt; page, review the information and wait for the hotfix e-mail to arrive.&lt;/li&gt;    &lt;li&gt;From the hotfix e-mail, open the link and download the .Zip file.&lt;/li&gt;    &lt;li&gt;Extract the .Zip file and provide the password included in the hotfix e-mail. MasterDataServices.msi will be extracted to the location you specify.&lt;/li&gt; &lt;/ol&gt;  &lt;h2&gt;Installing MDS cumulative updates on a server without an existing MDS installation&lt;/h2&gt;  &lt;p&gt;If your server does not have an existing MDS installation, you can follow the process documented in &lt;a href="http://msdn.microsoft.com/en-us/library/ee633752.aspx" target="_blank"&gt;Installing and Configuring Master Data Services&lt;/a&gt; in SQL Server BOL. However, instead of running MasterDataServices.msi from the product media as directed in the documentation, run MasterDataServices.msi from the location where you extracted it in the download process above. Then create and configure the MDS database, Master Data Manager Web application, and MDS Web services as documented in SQL Server BOL.&lt;/p&gt;  &lt;h2&gt;Applying MDS cumulative updates to an existing MDS installation&lt;/h2&gt;  &lt;p&gt;If you apply an MDS cumulative update to an existing installation of MDS, you must run the installation package and then use Master Data Services Configuration Manager to upgrade the database.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;Important&lt;/b&gt;&amp;nbsp;&amp;nbsp; Always test the update and upgrade process in a non-production environment before applying an update and upgrading the MDS database in your production environment.&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Before you start the upgrade process:&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;Open Internet Information Services (IIS) Manager and stop the Master Data Manager Web application and the MDS Web service (if enabled). You can do this either by stopping the application pool that contains the Web application and service, or you can stop the Web site that contains them. If you stop the application pool, you stop requests for all applications in that application pool. If you stop the Web site, you stop only traffic to the Web site and any applications and services it contains.&lt;/li&gt;    &lt;li&gt;Stop any operations, such as scheduled jobs, that affect the MDS database.&lt;/li&gt;    &lt;li&gt;Query &lt;b&gt;mdm.tblSystem&lt;/b&gt; in the current MDS database. Review value for &lt;b&gt;SchemaVersion&lt;/b&gt; and compare the value after you apply the MDS update to verify that the value has been increased.&lt;/li&gt;    &lt;li&gt;Take a current backup of the MDS database. If you are using the full recovery model, take a log backup immediately before you upgrade the database. If you are using the simple recovery model, take a full or differential database backup. For more information about backups, see “Backup Overview (SQL Server)” at &lt;a href="http://msdn.microsoft.com/library/ms175477(SQL.105).aspx"&gt;http://msdn.microsoft.com/library/ms175477(SQL.105).aspx&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;To apply an MDS cumulative update:&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;On the server where you want to install the update, navigate to the location where you extracted MasterDataServices.msi and double-click it.&lt;/li&gt;    &lt;li&gt;The following message appears: &lt;b&gt;A lower version of this product has been detected on your system. Would you like to upgrade your existing installation?&lt;/b&gt; Click &lt;b&gt;Yes&lt;/b&gt; to proceed with the upgrade process.&lt;/li&gt;    &lt;li&gt;The &lt;b&gt;Microsoft SQL Server 2008 R2 Master Data Services&lt;/b&gt; installation wizard opens. Follow the instructions in the wizard to configure installation options and then click &lt;b&gt;Install&lt;/b&gt;.&lt;/li&gt;    &lt;li&gt;After installation completes, &lt;b&gt;Master Data Services Configuration Manager&lt;/b&gt; opens so you can upgrade the MDS database.&lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;Databases&lt;/b&gt;, and then click &lt;b&gt;Select Database&lt;/b&gt;. Connect to the database you want to upgrade. Once the database is selected, the following message appears: &lt;b&gt;This database requires an upgrade. You cannot change system settings until the database is upgraded.&lt;/b&gt;&lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;Upgrade Database&lt;/b&gt;. The &lt;b&gt;Upgrade Database Wizard&lt;/b&gt; opens. Follow the instructions in the wizard to upgrade the database and then click &lt;b&gt;Finish&lt;/b&gt;.&lt;/li&gt;    &lt;li&gt;To verify that the database upgrade was successful, connect to the MDS database and query &lt;b&gt;mdm.tblSystem&lt;/b&gt;. The value for &lt;b&gt;SchemaVersion&lt;/b&gt; should be increased and match the value as specified for the individual cumulative update.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;If the update was unsuccessful, open &lt;b&gt;Control Panel&lt;/b&gt; and use &lt;b&gt;Programs and Features&lt;/b&gt; to uninstall &lt;b&gt;Microsoft SQL Server 2008 R2 Master Data Services&lt;/b&gt; and then re-run the steps in this procedure. &lt;/p&gt;  &lt;p&gt;After you apply the cumulative update and upgrade the database, start the Master Data Manager Web application, MDS Web service (if enabled in your environment), and any operations that you suspended prior to the upgrade process. Verify that your environment works as expected before you allow users to access the environment.&lt;/p&gt;</description></item></channel></rss>