<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ROW_OVERFLOW_DATA &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/row_overflow_data/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Tue, 14 Nov 2017 11:36:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server: Script to check the Allocation Units of a Table</title>
		<link>https://www.dbrnd.com/2017/08/sql-server-script-to-check-the-allocation-units-of-a-table/</link>
					<comments>https://www.dbrnd.com/2017/08/sql-server-script-to-check-the-allocation-units-of-a-table/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 06 Aug 2017 16:16:27 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Allocation unit]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[IN_ROW_DATA]]></category>
		<category><![CDATA[LOB_DATA]]></category>
		<category><![CDATA[ROW_OVERFLOW_DATA]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5787</guid>

					<description><![CDATA[In this post, I am sharing a script to check the available allocation units on a Table in SQL Server. When you create a table and stored data, it stored into different types of allocation units like IN_ROW_DATA, LOB_DATA, ROW_OVERFLOW_DATA. Already shared a couple of articles on the importance of allocation units like ROW_OVERFLOW_DATA. When [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-script-to-check-the-allocation-units-of-a-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20the%20Allocation%20Units%20of%20a%20Table" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-script-to-check-the-allocation-units-of-a-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20the%20Allocation%20Units%20of%20a%20Table" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-script-to-check-the-allocation-units-of-a-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20the%20Allocation%20Units%20of%20a%20Table" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-script-to-check-the-allocation-units-of-a-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20the%20Allocation%20Units%20of%20a%20Table" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-script-to-check-the-allocation-units-of-a-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20the%20Allocation%20Units%20of%20a%20Table" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-script-to-check-the-allocation-units-of-a-table%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20check%20the%20Allocation%20Units%20of%20a%20Table" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F08%2Fsql-server-script-to-check-the-allocation-units-of-a-table%2F&#038;title=SQL%20Server%3A%20Script%20to%20check%20the%20Allocation%20Units%20of%20a%20Table" data-a2a-url="https://www.dbrnd.com/2017/08/sql-server-script-to-check-the-allocation-units-of-a-table/" data-a2a-title="SQL Server: Script to check the Allocation Units of a Table"></a></p><p>In this post, I am sharing a script to check the available allocation units on a Table in SQL Server. When you create a table and stored data, it stored into different types of allocation units like IN_ROW_DATA, LOB_DATA, ROW_OVERFLOW_DATA.</p>
<p>Already shared a couple of articles on the importance of allocation units like ROW_OVERFLOW_DATA. When your data are exceeding 8KB pages, it stores into ROW_OVERFLOW_DATA which is also called internal fragmentation. </p>
<p>Using this script, you will get to know different allocations related information including page start number which helps you to do further require analysis on your table. </p>
<pre class="crayon-plain-tag">DECLARE @object SYSNAME = 'table_name'

SELECT
    OBJECT_NAME ([sp].[object_id]) AS [Object Name],
    [sp].[index_id] AS [Index ID],
    [sp].[partition_id] AS [Partition ID],
        [sa].[allocation_unit_id] AS [Alloc Unit ID],
    [sa].[type_desc] AS [Alloc Unit Type],
    '(' + CONVERT (VARCHAR (6),
        CONVERT (INT,
            SUBSTRING ([sa].[first_page], 6, 1) +
            SUBSTRING ([sa].[first_page], 5, 1))) +
    ':' + CONVERT (VARCHAR (20),
        CONVERT (INT,
            SUBSTRING ([sa].[first_page], 4, 1) +
            SUBSTRING ([sa].[first_page], 3, 1) +
            SUBSTRING ([sa].[first_page], 2, 1) +
            SUBSTRING ([sa].[first_page], 1, 1))) +
    ')' AS [First Page],
    '(' + CONVERT (VARCHAR (6),
        CONVERT (INT,
            SUBSTRING ([sa].[root_page], 6, 1) +
            SUBSTRING ([sa].[root_page], 5, 1))) +
    ':' + CONVERT (VARCHAR (20),
        CONVERT (INT,
            SUBSTRING ([sa].[root_page], 4, 1) +
            SUBSTRING ([sa].[root_page], 3, 1) +
            SUBSTRING ([sa].[root_page], 2, 1) +
            SUBSTRING ([sa].[root_page], 1, 1))) +
    ')' AS [Root Page],
    '(' + CONVERT (VARCHAR (6),
        CONVERT (INT,
            SUBSTRING ([sa].[first_iam_page], 6, 1) +
            SUBSTRING ([sa].[first_iam_page], 5, 1))) +
    ':' + CONVERT (VARCHAR (20),
        CONVERT (INT,
            SUBSTRING ([sa].[first_iam_page], 4, 1) +
            SUBSTRING ([sa].[first_iam_page], 3, 1) +
            SUBSTRING ([sa].[first_iam_page], 2, 1) +
            SUBSTRING ([sa].[first_iam_page], 1, 1))) +
    ')' AS [First IAM Page]
FROM
    sys.system_internals_allocation_units AS [sa],
    sys.partitions AS [sp]
WHERE
    [sa].[container_id] = [sp].[partition_id]
AND [sp].[object_id] =
(CASE WHEN (@object IS NULL)
    THEN [sp].[object_id]
    ELSE OBJECT_ID (@object)
END)</pre> </p>
<p><a href="https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-sp_allocationmetadata-putting-undocumented-system-catalog-views-to-work/" target="_blank">Reference is taken from sqlskills.com:</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/08/sql-server-script-to-check-the-allocation-units-of-a-table/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server: What happened, when Row Overflow and Data Exceeding 8KB?</title>
		<link>https://www.dbrnd.com/2016/04/sql-server-what-happened-when-row-overflow-and-data-exceeding-8kb/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 14 Apr 2016 20:50:26 +0000</pubDate>
				<category><![CDATA[Database Designing]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[data exceeding]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[IN_ROW_DATA]]></category>
		<category><![CDATA[ROW OVERFLOW]]></category>
		<category><![CDATA[ROW_OVERFLOW_DATA]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2292</guid>

					<description><![CDATA[In the previous article, I discussed the 8KB data page of the SQL Server, but what happened when the row is larger and cannot fit into a single 8KB page? Each row is strictly prohibited to use only 8KB size per data page, but the data type like char, varchar, nvarchar, and varbinary require more [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fsql-server-what-happened-when-row-overflow-and-data-exceeding-8kb%2F&amp;linkname=SQL%20Server%3A%20What%20happened%2C%20when%20Row%20Overflow%20and%20Data%20Exceeding%208KB%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fsql-server-what-happened-when-row-overflow-and-data-exceeding-8kb%2F&amp;linkname=SQL%20Server%3A%20What%20happened%2C%20when%20Row%20Overflow%20and%20Data%20Exceeding%208KB%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fsql-server-what-happened-when-row-overflow-and-data-exceeding-8kb%2F&amp;linkname=SQL%20Server%3A%20What%20happened%2C%20when%20Row%20Overflow%20and%20Data%20Exceeding%208KB%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fsql-server-what-happened-when-row-overflow-and-data-exceeding-8kb%2F&amp;linkname=SQL%20Server%3A%20What%20happened%2C%20when%20Row%20Overflow%20and%20Data%20Exceeding%208KB%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fsql-server-what-happened-when-row-overflow-and-data-exceeding-8kb%2F&amp;linkname=SQL%20Server%3A%20What%20happened%2C%20when%20Row%20Overflow%20and%20Data%20Exceeding%208KB%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fsql-server-what-happened-when-row-overflow-and-data-exceeding-8kb%2F&amp;linkname=SQL%20Server%3A%20What%20happened%2C%20when%20Row%20Overflow%20and%20Data%20Exceeding%208KB%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fsql-server-what-happened-when-row-overflow-and-data-exceeding-8kb%2F&#038;title=SQL%20Server%3A%20What%20happened%2C%20when%20Row%20Overflow%20and%20Data%20Exceeding%208KB%3F" data-a2a-url="https://www.dbrnd.com/2016/04/sql-server-what-happened-when-row-overflow-and-data-exceeding-8kb/" data-a2a-title="SQL Server: What happened, when Row Overflow and Data Exceeding 8KB?"></a></p><p><em>In the previous article, I discussed the <a href="https://www.dbrnd.com/2016/04/sql-server-the-internal-structure-of-the-data-page/" target="_blank"><strong>8KB data page of the SQL Server</strong></a>, but what happened when the row is larger and cannot fit into a single 8KB page?</em></p>
<blockquote><p>Each row is strictly prohibited to use only 8KB size per data page, but the data type like char, varchar, nvarchar, and varbinary require more space to store data into data page. </p></blockquote>
<blockquote><p>Sometimes, the individual column may fit in the limit of 8KB, but if we have multiple columns and the combination of all these types of columns exceeds the limit of 8KB, SQL Server moves data in different allocation unit or raise an error. </p>
<p>e.g. we have three separate columns like VARCHAR(MAX), CHAR(6000) and TEXT so combination of these all columns cannot fit in the 8KB size.</p></blockquote>
<blockquote><p>The SQL Server Database Engine moves the record column with the largest width to another page in the ROW_OVERFLOW_DATA allocation unit, and it is maintaining a 24-byte pointer on the original page. </p></blockquote>
<blockquote><p>To moving of the large records to another page is a dynamic process because records can become a larger at any point of time while executing UPDATE operations. </p>
<p>If the UPDATE operation makes a small size of the record, it backs to the original page in the IN_ROW_DATA allocation unit.</p></blockquote>
<blockquote><p>Whenever we are combining VARCHAR, NVARCHAR, BLOB, VARBINARY kind of data column in a table, internally SQL Server separates the data pages because it may exceed the 8KB row size.
</p></blockquote>
<blockquote><p><em><strong>My suggestion is:</strong> if we have large size of data columns, we should create a separate table for those columns. Because asynchronously, we can perform JOIN operations, which is performing better than selecting data from internal fragmented pages. </em>
</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
