<?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>data exceeds &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/data-exceeds/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>Sun, 25 Sep 2016 20:02:32 +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 find a Table which has more than 25 columns</title>
		<link>https://www.dbrnd.com/2016/10/sql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 30 Oct 2016 16:16:21 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[data exceeds]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[page split]]></category>
		<category><![CDATA[ROW OVERFLOW]]></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=3419</guid>

					<description><![CDATA[In this post, I am sharing one script to find a Table which has more than 25 columns in SQL Server. As per the MSDN, we can create 1024 columns in a single table, but here immediately next questions should be, What is the default size of one single page? It is only 8KB so [&#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%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2025%20columns" 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%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2025%20columns" 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%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2025%20columns" 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%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2025%20columns" 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%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2025%20columns" 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%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2025%20columns" 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%2F10%2Fsql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20a%20Table%20which%20has%20more%20than%2025%20columns" data-a2a-url="https://www.dbrnd.com/2016/10/sql-server-script-to-find-a-table-which-has-more-than-25-columns-row-overflow-data-exceeding-page-split/" data-a2a-title="SQL Server: Script to find a Table which has more than 25 columns"></a></p><p>In this post, I am sharing one script to find a Table which has more than 25 columns in SQL Server.</p>
<blockquote><p>As per the MSDN, we can create 1024 columns in a single table, but here immediately next questions should be,<br />
<strong>What is the default size of one single page?</strong><br />
It is only 8KB so if we create more columns and it exceeds 8KB size, it creates internal page fragmentation.</p></blockquote>
<blockquote class="wp-embedded-content" data-secret="nhl4Wmpj1K"><p><a href="https://www.dbrnd.com/2016/04/sql-server-the-internal-structure-of-the-data-page/">SQL Server: The Internal Structure of the Data Page</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-the-internal-structure-of-the-data-page/embed/#?secret=nhl4Wmpj1K" data-secret="nhl4Wmpj1K" width="600" height="338" title="&#8220;SQL Server: The Internal Structure of the Data Page&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="dY2YvoO0xm"><p><a href="https://www.dbrnd.com/2016/04/sql-server-what-happened-when-row-overflow-and-data-exceeding-8kb/">SQL Server: What happened, when Row Overflow and Data Exceeding 8KB?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/04/sql-server-what-happened-when-row-overflow-and-data-exceeding-8kb/embed/#?secret=dY2YvoO0xm" data-secret="dY2YvoO0xm" width="600" height="338" title="&#8220;SQL Server: What happened, when Row Overflow and Data Exceeding 8KB?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>I am not totally againts on this, but we should analyze before creating more columns in a table which gives us better performance.</p>
<p><strong>Below is a script to find tables which are having more columns:</strong></p>
<pre class="crayon-plain-tag">DECLARE @threshold INT;
SET @threshold = 25;

;WITH cte([object_id], [column count]) AS
(
	SELECT [object_id], COUNT(*)
	FROM sys.columns
	GROUP BY [object_id]
	HAVING COUNT(*) &gt; @threshold
)
SELECT 
	[s].[name] + '.' + [t].[name] AS TableName
    ,[cte].[column count]
FROM cte
INNER JOIN sys.tables AS t
	ON [cte].[object_id] = [t].[object_id]
INNER JOIN sys.schemas AS s
	ON [t].[schema_id] = [s].[schema_id]
ORDER BY [cte].[column count] DESC
GO</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
