<?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>Extra tabs and spaces &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/extra-tabs-and-spaces/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>Wed, 23 May 2018 19:09:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server: Extra Tabs and Spaces of object occupies more disk area</title>
		<link>https://www.dbrnd.com/2018/06/sql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 25 Jun 2018 16:16:13 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Extra tabs and spaces]]></category>
		<category><![CDATA[SQL Programming]]></category>
		<category><![CDATA[sql queries]]></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[sqlcode]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7663</guid>

					<description><![CDATA[<div><img width="679" height="679" src="https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-679x679.png" class="attachment-post-image size-post-image wp-post-image" alt="" decoding="async" fetchpriority="high" srcset="https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-679x679.png 679w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-150x150.png 150w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-300x300.png 300w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-600x600.png 600w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object.png 780w" sizes="(max-width: 679px) 100vw, 679px" /></div>In this post, I am sharing an interesting fact on the disk usage by extra tabs and spaces of SQL Server object&#8217;s definition. Many of you don&#8217;t know that extra spaces and tabs are occupying the disk in SQL Server. People are creating their own coding standard and giving a huge number of extra spaces [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="679" height="679" src="https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-679x679.png" class="attachment-post-image size-post-image wp-post-image" alt="" decoding="async" srcset="https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-679x679.png 679w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-150x150.png 150w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-300x300.png 300w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object-600x600.png 600w, https://www.dbrnd.com/wp-content/uploads/2018/05/SQL-Server-Taken-Extra-Space-of-Object.png 780w" sizes="(max-width: 679px) 100vw, 679px" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F06%2Fsql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area%2F&amp;linkname=SQL%20Server%3A%20Extra%20Tabs%20and%20Spaces%20of%20object%20occupies%20more%20disk%20area" 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%2F2018%2F06%2Fsql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area%2F&amp;linkname=SQL%20Server%3A%20Extra%20Tabs%20and%20Spaces%20of%20object%20occupies%20more%20disk%20area" 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%2F2018%2F06%2Fsql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area%2F&amp;linkname=SQL%20Server%3A%20Extra%20Tabs%20and%20Spaces%20of%20object%20occupies%20more%20disk%20area" 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%2F2018%2F06%2Fsql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area%2F&amp;linkname=SQL%20Server%3A%20Extra%20Tabs%20and%20Spaces%20of%20object%20occupies%20more%20disk%20area" 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%2F2018%2F06%2Fsql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area%2F&amp;linkname=SQL%20Server%3A%20Extra%20Tabs%20and%20Spaces%20of%20object%20occupies%20more%20disk%20area" 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%2F2018%2F06%2Fsql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area%2F&amp;linkname=SQL%20Server%3A%20Extra%20Tabs%20and%20Spaces%20of%20object%20occupies%20more%20disk%20area" 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%2F2018%2F06%2Fsql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area%2F&#038;title=SQL%20Server%3A%20Extra%20Tabs%20and%20Spaces%20of%20object%20occupies%20more%20disk%20area" data-a2a-url="https://www.dbrnd.com/2018/06/sql-server-extra-tabs-and-spaces-of-object-occupies-more-disk-area/" data-a2a-title="SQL Server: Extra Tabs and Spaces of object occupies more disk area"></a></p><p>In this post, I am sharing an interesting fact on the disk usage by extra tabs and spaces of SQL Server object&#8217;s definition.</p>
<p>Many of you don&#8217;t know that extra spaces and tabs are occupying the disk in SQL Server. People are creating their own coding standard and giving a huge number of extra spaces in the object definition. </p>
<blockquote><p>Nowadays, the disk is not that much costlier so few extra KBs/MBs we can afford. But I saw few servers, where companies are creating a separate database for each client and one database contained thousands of stored procedures. </p></blockquote>
<p><em>So I would suggest, please follow the best practices in your coding life.<br />
From tomorrow, I am going to share few articles on SQL Server Coding Standard and best practices.</em></p>
<p>Here, I created two stored procedures where one has extra tabs and other has normal spaces. You can easily get the size difference between these two stored procedures. </p>
<p><strong>Create sample Stored Procedure with extra Tabs and Spaces:</strong></p>
<pre class="crayon-plain-tag">CREATE PROCEDURE usp_ABC
AS
BEGIN
	DECLARE						@Name					VARCHAR(20)
	DECLARE						@Add					VARCHAR(100)	
END</pre> </p>
<p><strong>Create sample Stored Procedure without extra Tabs and Spaces:</strong></p>
<pre class="crayon-plain-tag">CREATE PROCEDURE usp_XYZ
AS
BEGIN
	DECLARE	@Name VARCHAR(20)
	DECLARE @Add VARCHAR(100)	
END</pre> </p>
<p><strong>Compare the size of above SPs:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	[p].[name]
	,size = DATALENGTH([asm].[definition]) 
FROM sys.all_sql_modules AS asm
INNER JOIN sys.procedures AS p
ON [asm].[object_id] = [p].[object_id]
WHERE [p].[name] IN ('usp_ABC','usp_XYZ')</pre> </p>
<p><strong>Result:</strong></p>
<pre class="crayon-plain-tag">name          size
-----------  ---------
usp_ABC	      230
usp_XYZ       198</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
