<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Journey to SQL Authority with Pinal Dave &#187; Best Practices</title>
	<atom:link href="http://blog.sqlauthority.com/category/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 01:30:19 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.sqlauthority.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/08e35387c05b61340e885b1763a69d9f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Journey to SQL Authority with Pinal Dave &#187; Best Practices</title>
		<link>http://blog.sqlauthority.com</link>
	</image>
			<item>
		<title>SQLAuthority News &#8211; Disk Partition Alignment Best Practices for SQL Server</title>
		<link>http://blog.sqlauthority.com/2009/11/14/sqlauthority-news-disk-partition-alignment-best-practices-for-sql-server/</link>
		<comments>http://blog.sqlauthority.com/2009/11/14/sqlauthority-news-disk-partition-alignment-best-practices-for-sql-server/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 01:30:12 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL White Papers]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7124</guid>
		<description><![CDATA[Disk partition alignment is a powerful tool for improving SQL Server performance. Configuring optimal disk performance is often viewed as much art as science. A best practice that is essential yet often overlooked is disk partition alignment. Windows Server 2008 attempts to align new partitions out-of-the-box, yet disk partition alignment remains a relevant technology for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7124&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Disk partition alignment is a powerful tool for improving SQL Server performance. Configuring optimal disk performance is often viewed as much art as science. A best practice that is essential yet often overlooked is disk partition alignment. Windows Server 2008 attempts to align new partitions out-of-the-box, yet disk partition alignment remains a relevant technology for partitions created on prior versions of Windows.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/diskpart.jpg" alt="" width="500" height="367" /></p>
<p style="text-align:justify;">This paper documents performance for aligned and nonaligned storage and why nonaligned partitions can negatively impact I/O performance; it explains disk partition alignment for storage configured on Windows Server 2003, including analysis, diagnosis, and remediation; and it describes how Windows Server 2008 attempts to remedy challenges related to partition alignment for new partitions yet does not correct the configuration of preexisting partitions.</p>
<p style="text-align:justify;">The following topics are also included: background information, implementation, vendor considerations, two essential correlations, valid starting partition offsets, and the simple protocol to align partitions, define file allocation unit size, and assign drive letters. It includes results from tests that show how partition alignment can affect performance for SQL Server 2008.</p>
<p style="text-align:justify;">The following topics are also included:</p>
<ul style="text-align:justify;">
<li>Background information</li>
<li>Implementation</li>
<li>Vendor considerations</li>
<li>Two essential correlations</li>
<li>Valid starting partition offsets</li>
</ul>
<p style="text-align:justify;">The paper also covers the simple protocol to align partitions, define file allocation unit size, and assign drive letters.</p>
<p style="text-align:justify;"><strong><a href="http://technet.microsoft.com/en-us/library/dd758814.aspx" target="_blank">Disk Partition Alignment Best Practices for SQL Server</a></strong></p>
<p style="text-align:justify;">
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
Posted in Best Practices, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQL White Papers, SQLAuthority News, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7124&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/11/14/sqlauthority-news-disk-partition-alignment-best-practices-for-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/diskpart.jpg" medium="image" />
	</item>
		<item>
		<title>SQLAuthority News &#8211; PASS 2009 Sessions on Query Optimization and Performance Tuning</title>
		<link>http://blog.sqlauthority.com/2009/10/20/sqlauthority-news-pass-2009-sessions-on-query-optimization-and-performance-tuning/</link>
		<comments>http://blog.sqlauthority.com/2009/10/20/sqlauthority-news-pass-2009-sessions-on-query-optimization-and-performance-tuning/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 01:30:56 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MVP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLAuthority Author Visit]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SQL PASS]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7169</guid>
		<description><![CDATA[PASS Summit 2009 is now only 10 days away and I am very excited for the same. I can not wait to attend the summit as this is the most awaited conference of SQL Server in world. Everybody will be there and there will be something for everybody. My core expertise is in Query Optimization [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7169&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/" target="_blank">PASS Summit 2009</a> is now only 10 days away and I am very excited for the same. I can not wait to attend the summit as this is the most awaited conference of SQL Server in world. Everybody will be there and there will be something for everybody. My core expertise is in Query Optimization and Performance Tuning area, and when I see the list of PASS session on the subject, I am totally speechless. There are so many great speaker at PASS who are there to talk on the subject.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/2009PASS_Signature02.gif" alt="" width="400" height="140" /></p>
<p style="text-align:justify;">It is absolutely not possible to attend all of them many of them are running parallel to each other. In any case, I strongly suggest if you are the expert who try till last bit to optimize the query and performance, I expect you to attend many of the following session. There is always option to get recorded DVD for the sessions afterwords.</p>
<p style="text-align:justify;">You can read my article here regarding <strong><a href="http://blog.sqlauthority.com/2009/09/11/sqlauthority-news-why-i-am-going-to-attend-pass-summit-unite-2009-seattle/" target="_blank">Why I am Going to Attend PASS Summit Unite 2009- Seattle</a></strong>.</p>
<p style="text-align:justify;">Here is my list of the sessions related to performance tuning and query optimization.</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/MakingEffectiveUseofthePlanCache.aspx" target="_blank">Making Effective Use of the Plan Cache</a><br />
Greg Low (Solid Q Australia)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/CapturingandAnalyzingFileWaitStats.aspx" target="_blank">Capturing and Analyzing File &amp; Wait Stats</a><br />
Andrew Kelly (Solid Quality Mentors)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/TSQLTipsTricks.aspx" target="_blank">T-SQL Tips &amp; Tricks</a><br />
Itzik Ben-Gan (Solid Quality Mentors)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/BestPracticesforWorkingWithExecutionPlans.aspx" target="_blank">Best Practices for Working With Execution Plans</a><br />
Grant Fritchey (FM Global)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/DMVsasaShortcuttoProcedureTuning.aspx" target="_blank">DMV&#8217;s as a Shortcut to Procedure Tuning</a><br />
Grant Fritchey (FM Global)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/Liesdamnedliesandstatistics.aspx" target="_blank">Lies, damned lies and statistics</a><br />
Gail Shaw (XpertEase)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/InsightintoIndexes.aspx" target="_blank">Insight into Indexes</a><br />
Gail Shaw (XpertEase)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/EnhanceyourTSQLtoperformbetter.aspx" target="_blank">Enhance your T-SQL to perform better</a><br />
Joe Webb (WebbTech Solutions, LLC)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/InsidetheManagementDataWarehouse.aspx" target="_blank">Exploring Index Internals</a><br />
Kalen Delaney (SQLearning)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/SuperBowlSuperLoadALookatPerformance.aspx" target="_blank">Super Bowl, Super Load &#8211; A Look at Performance Tuning for VLDB&#8217;&#8217;s</a><br />
Michelle Ufford (GoDaddy)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/OptimizingSQLServer2008ApplicationsusingTabl.aspx" target="_blank">Optimizing SQL Server 2008 Applications using Table Valued Parameters, XML and MERGE</a><br />
Tobias Ternstrom (Microsoft Corp.)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/SQLServerExecutionPlansFromCompilationTo.aspx" target="_blank">SQL Server Execution Plans From Compilation To Caching To Reuse</a><br />
Maciej Pilecki (Project Botticelli Ltd.)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/UsingSQLServer2008forPerformanceTuning.aspx" target="_blank">Using SQL Server 2008 for Performance Tuning</a><br />
Buck Woody (Microsoft Corp.)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/SQLCATDesigningHighPerformanceIOforSQLSer.aspx" target="_blank">SQLCAT: Designing High Performance I/O for SQL Server (90 Mins)</a><br />
Thomas Kejser (Microsoft Corp.)<br />
Mike Ruthruff (Microsoft SQL CAT)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/SQLServer20052008PerformanceTuningandOpti.aspx" target="_blank">SQL Server 2005 / 2008 Performance Tuning and Optimization Techniques (90 Mins)</a><br />
David Pless (Microsoft CSS)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/DrDMVHowtoUseDynamicManagementViews.aspx" target="_blank">Dr. DMV: How to Use Dynamic Management Views to Monitor and Diagnose Performance Issues With High Volume OLTP Workloads</a><br />
Glenn Berry (NewsGator Technologies)</p>
<p style="text-align:justify;"><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/HowtheQueryOptimizerWorks.aspx" target="_blank">How the Query Optimizer Works</a><br />
Ben Nevarez (AIG)</p>
<p style="text-align:justify;"><strong>I will personally try to attend many of the above listed sessions. Here are two sessions not from above list, which I will be sure attending. You are encouraged to meet me and attend this two rock star sessions.</strong></p>
<p style="text-align:justify;"><strong><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/OvercomingSSISDeploymentandConfigurationChall.aspx" target="_blank">Overcoming SSIS Deployment and Configuration Challenges</a></strong><br />
Rushabh Mehta (Solid Quality Learning)</p>
<p style="text-align:justify;"><strong><a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/SQLServer2008CreatepowerfulXMLSchema.aspx" target="_blank">SQL Server 2008 &#8211; Create powerful XML Schema collections to validate your XML documents</a></strong><br />
Jacob Sebastian (beyondrelational.com)</p>
<p style="text-align:justify;">Let me know what sessions you will be sure attending by leaving your comment here. It would be good idea to create the list of the session which one is confident about attending.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Database, MVP, SQL, SQL Authority, SQL Optimization, SQL Performance, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority Author Visit, SQLAuthority News, T SQL, Technology Tagged: PASS, SQL PASS <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7169/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7169&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/10/20/sqlauthority-news-pass-2009-sessions-on-query-optimization-and-performance-tuning/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/2009PASS_Signature02.gif" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Interesting Observation &#8211; Query Hint &#8211; FORCE ORDER</title>
		<link>http://blog.sqlauthority.com/2009/10/06/sql-server-interesting-observation-query-hint-force-order/</link>
		<comments>http://blog.sqlauthority.com/2009/10/06/sql-server-interesting-observation-query-hint-force-order/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 01:30:17 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Index]]></category>
		<category><![CDATA[SQL Joins]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Puzzle]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6916</guid>
		<description><![CDATA[SQL Server never stops to amaze me. As regular readers of this blog already know that besides conducting corporate training, I work on large-scale projects on query optimizations and server tuning projects. In one of the recent projects, I have noticed that a Junior Database Developer used the query hint Force Order; when I asked [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6916&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">SQL Server never stops to amaze me. As regular readers of this blog already know that besides conducting corporate training, I work on large-scale projects on query optimizations and server tuning projects. In one of the recent projects, I have noticed that a Junior Database Developer used the query hint Force Order; when I asked for details, I found out that the basic concept was not properly understood by him.</p>
<p style="text-align:justify;">Today, let us try to understand its working and the effect of this hint. Further, we will see the extent of difference in performance created by this one query hint. I also have one interesting question for all of you as well; I will give the answer in one of my later posts.</p>
<p style="text-align:left;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:magenta;">COUNT</span><span style="color:gray;">(*) </span><span style="color:black;">CountEmployee </span><span style="color:green;">-- 290 Rows<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Employee<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:magenta;">COUNT</span><span style="color:gray;">(*) </span><span style="color:black;">CountEmployeeAddress </span><span style="color:green;">-- 290 Rows<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.EmployeeAddress<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:magenta;">COUNT</span><span style="color:gray;">(*) </span><span style="color:black;">CountEmployeeDepartmentHistory </span><span style="color:green;">-- 296 Rows<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.EmployeeDepartmentHistory<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Employee e<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">HumanResources.EmployeeAddress ea </span><span style="color:blue;">ON </span><span style="color:black;">ea.EmployeeID </span><span style="color:blue;">= </span><span style="color:black;">e.EmployeeID<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">HumanResources.EmployeeDepartmentHistory edh </span><span style="color:blue;">ON </span><span style="color:black;">edh.EmployeeID </span><span style="color:blue;">= </span><span style="color:black;">e.EmployeeID<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Employee e<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">HumanResources.EmployeeAddress ea </span><span style="color:blue;">ON </span><span style="color:black;">ea.EmployeeID </span><span style="color:blue;">= </span><span style="color:black;">e.EmployeeID<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">HumanResources.EmployeeDepartmentHistory edh </span><span style="color:blue;">ON </span><span style="color:black;">edh.EmployeeID </span><span style="color:blue;">= </span><span style="color:black;">e.EmployeeID<br />
</span><span style="color:blue;">OPTION </span><span style="color:gray;">(</span><span style="color:black;">FORCE </span><span style="color:blue;">ORDER</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span></code></p>
<p style="text-align:justify;">In above example, I have used three tables and their row count is listed as well. Employee and EmployeeAddress – both have same number rows, and EmployeeDepartmentHistory table has around 6 rows more than the other two tables. Now let us run the query without using OPTION (FORCE ORDER) and run it along with the query hint and check the execution plan. You will find a difference in the query cost.</p>
<p style="text-align:justify;">We all accept that the table with least number of rows should be listed as the base table, and the same is done here. We have two such tables with the least number of rows, which are listed as base tables. Now before we further explain this, let us see the execution plan for the same.</p>
<p style="text-align:justify;">
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/forceorder.jpg" alt="" width="500" height="404" /></p>
<p style="text-align:justify;">It is very clear from the above execution plan that when I order is forced the query cost goes high. This proves that the SQL Server has already made a good decision with regard to the optimized query plan. When plan is forced in the case of the joins more than 2 table the performance matters. Let us see the execution order of the table in both the cases.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/forceorder1.jpg" alt="" width="500" height="618" /></p>
<p style="text-align:justify;">Now, from the example, it is very clear when you force order the query, it evaluates the table Employee first and when it is not forced, it evaluates EmployeeAddress first. Even though both the tables have same number of rows, the query optimizer processes them differently and uses different types of join logic. When the order is not forced, it uses hash join; further, in case of forced order, it uses nested loop – this creates a significant difference in the query cost.</p>
<p style="text-align:justify;">The conclusion of this whole exercise is very simple.</p>
<ul style="text-align:justify;">
<li>SQL      Server Query Execution Engine is pretty smart to decide the best execution      plan with least query cost for any query.</li>
<li>Order      of the tables in any query can make a significant impact on the query.</li>
</ul>
<p style="text-align:justify;">Now the question for you: We have seen that using query hint of OPTION (FORCE ORDER) reduces the performance; give an example wherein we can use this hint to improve the performance?</p>
<p style="text-align:justify;">Please leave your comment here. I will publish the answer to this question with due credit and with my own example in a later post.</p>
<p style="text-align:justify;">Reference: <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Index, SQL Joins, SQL Optimization, SQL Performance, SQL Puzzle, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6916/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6916&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/10/06/sql-server-interesting-observation-query-hint-force-order/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/forceorder.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/forceorder1.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Download Script of Change Data Capture (CDC)</title>
		<link>http://blog.sqlauthority.com/2009/09/01/sql-server-download-script-of-change-data-capture-cdc/</link>
		<comments>http://blog.sqlauthority.com/2009/09/01/sql-server-download-script-of-change-data-capture-cdc/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 01:30:24 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Download]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6688</guid>
		<description><![CDATA[My article written on subject of Introduction to Change Data Capture (CDC) in SQL Server 2008 is quite a popular and I have received many request for uploading the script associated with this subject.
Change Data Capture records INSERTs, UPDATEs, and DELETEs applied to SQL Server tables, and makes a record available of what changed, where, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6688&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">My article written on subject of <strong><a href="http://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-%28cdc%29-in-sql-server-2008/" target="_blank">Introduction to Change Data Capture (CDC)</a></strong> in SQL Server 2008 is quite a popular and I have received many request for uploading the script associated with this subject.</p>
<p style="text-align:justify;">Change Data Capture records INSERTs, UPDATEs, and DELETEs applied to SQL Server tables, and makes a record available of what changed, where, and when, in simple relational &#8216;change tables&#8217; rather than in an esoteric chopped salad of XML. These change tables contain columns that reflect the column structure of the source table you have chosen to track, along with the metadata needed to understand the changes that have been made. Pinal Dave explains all, with plenty of examples in a simple introduction.</p>
<p style="text-align:justify;"><strong><a href="http://www.pinaldave.com/best-sql-server-download.cfm?Download=cdc" target="_blank">Download Script of Change Data Capture (CDC)</a></strong></p>
<p style="text-align:justify;">Please leave your comments <a href="http://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-%28cdc%29-in-sql-server-2008/" target="_blank">here </a>if you have liked above article and script.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Download, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6688/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6688&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/09/01/sql-server-download-script-of-change-data-capture-cdc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Best Practices – Implementation of Database Object Schemas</title>
		<link>http://blog.sqlauthority.com/2009/08/28/sql-server-best-practices-%e2%80%93-implementation-of-database-object-schemas/</link>
		<comments>http://blog.sqlauthority.com/2009/08/28/sql-server-best-practices-%e2%80%93-implementation-of-database-object-schemas/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 01:30:11 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Download]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL White Papers]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6643</guid>
		<description><![CDATA[Microsoft SQL Server 2005 introduced the concept of database object schemas. Schemas are analogous to separate namespaces or containers used to store database objects. Security permissions apply to schemas, making them an important tool for separating and protecting database objects based on access rights. Schemas reduce the work required, and improve the flexibility, for security-related [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6643&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Microsoft SQL Server 2005 introduced the concept of database object schemas. Schemas are analogous to separate namespaces or containers used to store database objects. Security permissions apply to schemas, making them an important tool for separating and protecting database objects based on access rights. Schemas reduce the work required, and improve the flexibility, for security-related administration of a database.</p>
<p style="text-align:justify;">This white paper discusses the opportunities for improvements in the security administration of a user database, and it outlines some best practices around using schemas to manage database objects in development and production databases. Specifically, it addresses three real-world scenarios:</p>
<ul style="text-align:justify;">
<li>Protecting database objects from being altered by users without the knowledge of the database owner</li>
<li>Preventing database base objects, independent software vendor (ISV) databases in particular, from ad hoc or incorrect user access leading to poor application performance</li>
<li>Bringing related groups of objects (logical entities) together within one physical database to reduce physical database administrative overhead</li>
</ul>
<p style="text-align:justify;"><a href="http://msdn.microsoft.com/en-us/library/dd283095.aspx" target="_blank">Download SQL Server Best Practices – Implementation of Database Object Schemas</a></p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, SQL, SQL Authority, SQL Download, SQL Query, SQL Server, SQL Tips and Tricks, SQL White Papers, SQLAuthority News, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6643/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6643&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/28/sql-server-best-practices-%e2%80%93-implementation-of-database-object-schemas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQLAuthority News &#8211; USB Drive Fails to Copy Large File</title>
		<link>http://blog.sqlauthority.com/2009/08/14/sqlauthority-news-usb-drive-fails-to-copy-large-file/</link>
		<comments>http://blog.sqlauthority.com/2009/08/14/sqlauthority-news-usb-drive-fails-to-copy-large-file/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 01:30:31 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Error Messages]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6593</guid>
		<description><![CDATA[I am currently traveling on a month-long training assignment for Business Intelligence. For demonstration purposes, I use Virtual PC files and hands-on lab examples for attendees of the training. The size of my VPC file is about 15 GB. Initially, I copy this file to a USB Drive and then move it to other computers, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6593&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I am currently traveling on a month-long training assignment for Business Intelligence. For demonstration purposes, I use Virtual PC files and hands-on lab examples for attendees of the training. The size of my VPC file is about 15 GB. Initially, I copy this file to a USB Drive and then move it to other computers, as needed.</p>
<p style="text-align:justify;">Recently, while trying to copy my VPC file to my USB drive I received the following error:</p>
<p style="text-align:justify;"><strong>Error Copying File or Folder. Cannot Copy. There is not enough free disk space.</strong></p>
<p style="text-align:justify;">I had never experienced this problem before. I tried copying it a few more times using different copy methods and the command line. No matter what I tried, I received the same error message.  I finally decided to check the file system of the USB drive and discovered that it is FAT32. Filesystem FAT32 only supports a maximum file-size of 4 GB file, where as filesystem NTFS does not have this limitation. I had not come across FAT32 for more that two years and had completely forgotten about this limitation. I re-formatted the USB drive with NTFS. After this, it worked fine and I was able to copy my large VPC file successfully.</p>
<p style="text-align:justify;">I used GUI to format my drive, but if you prefer, you can also do it using Command Prompt.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/format.png" alt="" width="272" height="469" /></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/format1.png" alt="" width="514" height="145" /></p>
<p style="text-align:justify;">While this article may not be directly related to SQL Servers, SQL Server Database files can be extremely large at times. If a SQL Expert faces this kind of situation in future, it may be helpful.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Error Messages, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6593/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6593/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6593&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/14/sqlauthority-news-usb-drive-fails-to-copy-large-file/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/format.png" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/format1.png" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Backup master Database Interval &#8211; master Database Best Practices</title>
		<link>http://blog.sqlauthority.com/2009/08/12/sql-server-backup-master-database-interval-master-database-best-practices/</link>
		<comments>http://blog.sqlauthority.com/2009/08/12/sql-server-backup-master-database-interval-master-database-best-practices/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 01:30:32 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Backup and Restore]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6578</guid>
		<description><![CDATA[During a recent consultancy project, I was asked to review a Database Backup plan. While going through the plan, I noticed that there was no backup for the master database. When I questioned this, the DBA informed me that it was not necessary. I was startled and couldn’t resist explaining to him that the master [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6578&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">During a recent consultancy project, I was asked to review a Database Backup plan. While going through the plan, I noticed that there was no backup for the master database. When I questioned this, the DBA informed me that it was not necessary. I was startled and couldn’t resist explaining to him that the master database contains all the logon accounts details, as well as all the system-level database configuration. He was a little astounded and asked me to tell him at what intervals he should backup the master database. The discussion that followed was very thought provoking and I would like to share the major points with you:</p>
<ul style="text-align:justify;">
<li>The master database is the most      important database of all and the most recent version of the backup should      be available in the case of disaster.</li>
<li>Backup of the master database      should be made for:
<ul>
<li>Changing server-level       configuration settings;</li>
<li>Changing database-level       configuration settings; and</li>
<li>Changing any logon accounts details.</li>
</ul>
</li>
</ul>
<p style="text-align:justify;">On further observation of his master database, I found that he has some system maintenance Stored Procedure created in the master database. This should not be the case. The master database should not contain any user-created objects. Users should not be required to modify or create anything in the master database. The real purpose of the master database is for the SQL Server to maintain itself. Users only need to make backups and restore when needed.</p>
<p style="text-align:justify;">Do you backup your master database? Please leave your comments here.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Backup and Restore, SQL Query, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6578/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6578&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/08/12/sql-server-backup-master-database-interval-master-database-best-practices/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; 2008 &#8211; Copy Database With Data &#8211; Generate T-SQL For Inserting Data From One Table to Another Table</title>
		<link>http://blog.sqlauthority.com/2009/07/29/sql-server-2008-copy-database-with-data-generate-t-sql-for-inserting-data-from-one-table-to-another-table/</link>
		<comments>http://blog.sqlauthority.com/2009/07/29/sql-server-2008-copy-database-with-data-generate-t-sql-for-inserting-data-from-one-table-to-another-table/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 01:30:03 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=6043</guid>
		<description><![CDATA[Just about a year ago, I had written on the subject of how to insert data from one table to another table without generating any script or using wizard in my article SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE. Today, we will go [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6043&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Just about a year ago, I had written on the subject of how to insert data from one table to another table without generating any script or using wizard in my article <a href="http://blog.sqlauthority.com/2007/08/15/sql-server-insert-data-from-one-table-to-another-table-insert-into-select-select-into-table/" target="_blank">SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE</a>. Today, we will go over a similar question regarding how to generate script for data from database as well as table. SQL Server 2008 has simplified everything.</p>
<p style="text-align:justify;">Let us take a look at an example where we will generate script database. In our example, we will just take one table for convenience.</p>
<p style="text-align:justify;">Right Click on Database &gt;&gt; Tasks &gt;&gt; Generate Scripts &gt;&gt;</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data1.jpg" alt="" width="500" height="428" /></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data2.jpg" alt="" width="501" height="451" /></p>
<p style="text-align:justify;">This will pop up Generate SQL Server Scripts Wizards &gt;&gt; Click on Next &gt;&gt; Select Database &gt;&gt; This will bring up a screen that will suggest to Choose Script Option.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data3.jpg" alt="" width="501" height="451" /></p>
<p style="text-align:justify;">On Choose Script Option Screen of Script Wizard under section Table/View Options Look at Script Data row and Turn the Option to True.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data4.jpg" alt="" width="503" height="795" /></p>
<p style="text-align:justify;">The Next Screen will ask about object types. Select all the objects that are required in the generated script. Depending on the previous screen it will show few more screen requesting details about the objects required in script generation.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data5.jpg" alt="" width="501" height="514" /></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data6.jpg" alt="" width="501" height="514" /></p>
<p style="text-align:justify;">On the very last screen it will request output options. Select the desired output options of Script to file, Script to Clipboard or Script New Query Window.3</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data7.jpg" alt="" width="501" height="514" /></p>
<p style="text-align:justify;">Clicking on Finish button will generate a review screen containing the required objects along with script generating data.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data8.jpg" alt="" width="501" height="549" /></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data9.jpg" alt="" width="501" height="549" /></p>
<p style="text-align:justify;">Clicking on Finish button one more time will generate the requested output.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/data10.jpg" alt="" width="500" height="423" /></p>
<p style="text-align:justify;">Similarly, if you want to generate data for only one table, you can right click on the table and follow almost a similar wizard. I am sure this neat feature will help everybody who has been requesting for it for a long time.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Database, DBA, Pinal Dave, Readers Question, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/6043/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/6043/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/6043/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/6043/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/6043/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/6043/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/6043/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/6043/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/6043/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/6043/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=6043&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/07/29/sql-server-2008-copy-database-with-data-generate-t-sql-for-inserting-data-from-one-table-to-another-table/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/data1.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data2.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data3.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data4.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data5.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data6.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data7.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data8.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data9.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/data10.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; Clustered Index on Separate Drive From Table Location</title>
		<link>http://blog.sqlauthority.com/2009/06/18/sql-server-clustered-index-on-separate-drive-from-table-location/</link>
		<comments>http://blog.sqlauthority.com/2009/06/18/sql-server-clustered-index-on-separate-drive-from-table-location/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 01:30:39 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Constraint and Keys]]></category>
		<category><![CDATA[SQL Index]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=5491</guid>
		<description><![CDATA[How to improve performance of SQL Server Queries is a common topic of discussion among many of us. Much has been said, much has been discussed. Few days back, I had an interesting discussion with one of the Junior developers regarding performance improvement of SQL Server Queries. We discussed on how by using a separate [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5491&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><strong>How to improve performance of SQL Server Queries</strong> is a common topic of discussion among many of us. Much has been said, much has been discussed. Few days back, I had an interesting discussion with one of the Junior developers regarding performance improvement of SQL Server Queries. We discussed on how by using a separate hard drive for several database objects can right away improve performance. I suggested him that non clustered index and tempdb can be created on a separate disk to improve performance.</p>
<p style="text-align:justify;">No sooner had I given my suggestion than I received a question &#8211; What will happen if we can create clustered index on a separate drive from the table on which it is built.</p>
<p style="text-align:justify;">My answer is : <strong>No! </strong>It is not possible at all.</p>
<p style="text-align:justify;">Let us first be clear about the difference between a clustered and a non clustered index.</p>
<p style="text-align:justify;"><strong>Clustered Index</strong></p>
<ul>
<li>Only 1 allowed per table</li>
<li>Physically rearranges data in the table to conform to the index constraints</li>
<li>For use on columns that are frequently searched for ranges of data</li>
<li>For use on columns with low selectivity</li>
</ul>
<p style="text-align:justify;"><strong>Non-Clustered Index</strong></p>
<ul>
<li>Up to 249 (for SQL Server 2005) and 999 (for SQL Server 2008) allowed per table</li>
<li>Creates a separate list of key values with pointers to the location of the data in the data pages</li>
<li>For use on columns that are searched for single values</li>
<li>For use on columns with high selectivity</li>
</ul>
<p style="text-align:justify;">A table devoid of primary key index is called heap, and here data is not arranged in a particular order, which gives rise to issues that adversely affect performance. Data must be stored in some kind of order. If we put clustered index on it then the order will be forced by that index and the data will be stored in that particular order.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.sqlauthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Constraint and Keys, SQL Index, SQL Optimization, SQL Performance, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/5491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/5491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/5491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/5491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/5491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/5491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/5491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/5491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/5491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/5491/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=5491&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/06/18/sql-server-clustered-index-on-separate-drive-from-table-location/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Questions and Answers with Database Administrators</title>
		<link>http://blog.sqlauthority.com/2009/05/11/sql-server-questions-and-answers-with-database-administrators/</link>
		<comments>http://blog.sqlauthority.com/2009/05/11/sql-server-questions-and-answers-with-database-administrators/#comments</comments>
		<pubDate>Mon, 11 May 2009 01:30:58 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Coding Standards]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4474</guid>
		<description><![CDATA[I have been in India for long time now, and at present, I am managing a very large outsourcing project. Recently, we conducted few interviews since the project required more Database Administrators and Senior Developers, and I must say it was an enthralling experience for me! I got the opportunity to meet some very talented [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4474&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I have been in India for long time now, and at present, I am managing a very large outsourcing project. Recently, we conducted few interviews since the project required more Database Administrators and Senior Developers, and I must say it was an enthralling experience for me! I got the opportunity to meet some very talented and competent programmers from all over the country. Scores of interesting questions were discussed between the interviewers and the candidates, which made the whole interview process nothing short of an enriching occasion! I am listing some of the interesting questions discussed during the interviews. Some are technical and some are purely my personal opinion.</p>
<p style="text-align:justify;"><strong>Q. According to you what goes into making the best Database Administrator?</strong></p>
<p style="text-align:justify;">A. The primary job of DBAs is to secure the data. They should be able to keep it safe as well as reproduce it efficiently, whenever required. So as per my view, a Database Administrator who can fulfill the requirements of Securing Data and Retrieving Data is the best DBA.</p>
<p style="text-align:justify;">When I hire a DBA I always ask them questions about backup strategies and efficient restoring methodologies.<br />
<strong><br />
Q. I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup?</strong>
</p>
<p style="text-align:justify;">A. You cannot restore the database without having a full database backup. However, if you have the copy of all the data files (.mdf and .ndf) and logs (.ldf) when database was in working condition (or your desired state) it is possible to  attach that database using sp_attach_db.</p>
<p style="text-align:justify;"><strong>Q. As per your opinion what are the five top responsibilities of a DBA?</strong></p>
<p style="text-align:justify;">A.  I rate the following five tasks as the key responsibilities of a DBA.</p>
<p style="text-align:justify;">1. Securing database from physical and logical integrity damage.<br />
2. Restoring database from backup as a part of disaster management plan.<br />
3. Optimizing queries performance by appropriate indexing and optimizing joins, where conditions, select clause etc.<br />
4. Designing new schema, support legacy schema, and legacy database systems.<br />
5. Helping developers improve their SQL-related code writing skill.
</p>
<p style="text-align:justify;"><strong>Q. One of the developers in my company moved one of the columns from one table to some other table in the same database. How can I find the name of the new table where the column has been moved?</strong></p>
<p style="text-align:justify;">A. This question can be answered by querying system views.</p>
<p style="text-align:justify;">For SQL Server 2005 run the following code:<br />
<code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">OBJECT_NAME</span><span style="color:gray;">(</span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">) </span><span style="color:black;">TableName<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.columns<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">name </span><span style="color:blue;">= </span><span style="color:red;">'YourColumnName' </span></code></p>
<p style="text-align:justify;">The previous query will return all the tables that use the column name specified in the WHERE condition. This is a very small but a very handy script.<br />
<strong><br />
Q. What is the difference between SQL Server 2000 object owner and SQL Server 2005 schema?</strong>
</p>
<p style="text-align:justify;">A. Let us first see the fully qualified query name to access a table for SQL Server 2000 and SQL Server 2005.</p>
<p style="text-align:justify;"><strong>SQL Server 2000:</strong> [DataBaseServer].[DataBaseName].[ObjectOwner].[Table]</p>
<p style="text-align:justify;"><strong>SQL Server 2005:</strong> [DataBaseServer].[DataBaseName].[Schema].[Table]</p>
<p style="text-align:justify;"><strong>SQL Server 2008:</strong> [DataBaseServer].[DataBaseName].[Schema].[Table]</p>
<p style="text-align:justify;">In SQL Server 2000, prior to dropping the user who owns database objects, all the objects belonging to that user either need to be dropped or their owner has to be changed. Every time a user is dropped or modified, system admin has to undergo this inconvenient process.<br />
In SQL Server 2005 and the later versions, instead of accessing a database through database owner, it can be accessed through a schema. Users are assigned to schemas, and by using this schema a user can access database objects. Multiple users can be assigned to a single schema, and they all can automatically receive the same permissions and credentials as the schema to which they are assigned. Because of the same reason in SQL Server 2005 and the later versions &#8211; when a user is dropped from database &#8211; there is no negative effect on the database itself.
</p>
<p style="text-align:justify;"><strong>Q. What is BI? I have heard this term before but I have no idea about it?</strong></p>
<p style="text-align:justify;">A. BI stands for Business Intelligence. Microsoft started to promote the acronym BI since the launch of SQL Server 2005. However, it has been in use for a long time. The basic idea of BI is quite similar to Data Warehousing. Business intelligence is a method for storing and presenting accurate and timely key enterprise data to CXO, IT Managers, Business Consultants, and distributed teams of a company, to provide them with up-to-date information to drive intelligent decisions for business success, which ultimately leads to enhanced revenue, reduced risk, decreased cost, and better operational control for business agility and competitiveness. An effective BI empowers end users to use data to understand the cause that led to a particular business result, to decide on the course of action based on past data, and to accurately forecast future results.</p>
<p style="text-align:justify;"><strong>Q. What is your recommendation for a query running very slow?</strong></p>
<p style="text-align:justify;">A. Well, your question is very difficult to answer without looking at the code, application and physical server. In such situations, there are a few things that must be paid attention to right away.</p>
<ul style="text-align:justify;">
<li>Restart Server</li>
<li>Upgrade Hardware</li>
<li>Check Indexes on Tables and Create Indexes if necessary</li>
<li>Make sure SQL Server has priority over other operating system processes in SQL Server settings</li>
<li>Update statistics on the database tables.</li>
</ul>
<p style="text-align:justify;"><strong>Q. What should be the fill factor for Indexes created on tables?</strong></p>
<p style="text-align:justify;">A. Fill factor specifies a percentage that indicates how full the Database Engine should make the leaf level of each index page during index creation or alteration. Fill factor must be an integer value from 1 to 100. The default is 0. I prefer to keep my servers default fill factor as 90.</p>
<p style="text-align:justify;"><strong>Q. Which feature in SQL Server 2008 has surprised you? You can name just one.</strong></p>
<p style="text-align:justify;">A. Plan Freezing is a new feature I never thought of. I find it very interesting!  It is included in SQL Server 2008 CTP5. SQL Server 2008 enables greater query performance stability and predictability by providing new functionality to lock down query plans. This empowers organizations to promote stable query plans across hardware server replacements, server upgrades, and production deployments.</p>
<p style="text-align:justify;"><strong>Q. How do you test your database?</strong></p>
<p style="text-align:justify;">This is a very generic question. I would like to describe my generic database testing method as well as stored procedure testing methods.</p>
<p style="text-align:justify;">Testing Databases:</p>
<ul style="text-align:justify;">
<li>Table Column data type and data value validation.</li>
<li>Index implementation and performance improvement.</li>
<li>Constraints and Rules should be validated for data integrity.</li>
<li>Application field length and type should match the corresponding database field.</li>
<li>Database objects like stored procedures, triggers, functions should be tested using different kinds of input values and checking the expected output variables.</li>
</ul>
<p style="text-align:justify;">Testing Stored Procedures:</p>
<ul style="text-align:justify;">
<li>Understand the requirements in terms of Business Logic.</li>
<li>Check if the  code follows all the coding standards.</li>
<li>Compare the fields&#8217; requirements of application to the fields retrieved by a stored procedure. They must match.</li>
<li>Repeatedly run the stored procedures several times with different input parameters and then compare the output with the expected results.</li>
<li>Pass invalid input parameters and see if a stored procedure has good error handling.</li>
</ul>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>), </strong><a href="http://dotnetslackers.com/articles/sql/QuestionAnswersWithDataBaseAdministrators.aspx" target="_blank">DotNetSlackers</a><strong><br />
</strong></p>
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Coding Standards, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4474/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4474&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/05/11/sql-server-questions-and-answers-with-database-administrators/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; 10 Reasons for Database Outsourcing</title>
		<link>http://blog.sqlauthority.com/2009/05/10/sql-server-10-reasons-for-database-outsourcing/</link>
		<comments>http://blog.sqlauthority.com/2009/05/10/sql-server-10-reasons-for-database-outsourcing/#comments</comments>
		<pubDate>Sun, 10 May 2009 01:30:10 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Readers Contribution]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Outsourcing Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4885</guid>
		<description><![CDATA[10 Reasons for Database Outsourcing
While you may feel that your IT material is safe and handled effectively within your own company, these reasons may give you some perspective on why you may want to consider other options.
Cost Reduction &#8211; Perhaps the most popular reason to outsource your database is the overall reduction in cost that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4885&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><strong>10 Reasons for Database Outsourcing</strong></p>
<p style="text-align:justify;"><em>While you may feel that your IT material is safe and handled effectively within your own company, these reasons may give you some perspective on why you may want to consider other options.</em></p>
<p style="text-align:justify;"><strong>Cost Reduction</strong> &#8211; Perhaps the most popular reason to outsource your database is the overall reduction in cost that would benefit your company.  No longer do you have to pay people to check up and maintain your servers, verify that they have uninterrupted power supplies, and ensure their security from hackers.  By going with an IT company that does this exclusively, you can save money on your end because they make money by volume.</p>
<p style="text-align:justify;"><strong>Bigger Can Mean Better</strong> &#8211; Larger IT outsourcing companies are experts at what they do; there&#8217;s a reason they have made it to the top of the data storage field.  Not only will they have the resources to back up your data, perhaps multiple times, but they do business by serving many clients, which meant they have the power and money to get the latest technology.</p>
<p style="text-align:justify;"><strong>Newer Technology</strong> &#8211; Firms that specialize in storage can&#8217;t afford to let their systems go out of style or date because that could jeopardize their business.  Going with them means you won&#8217;t have to worry about constantly updating your systems.</p>
<p style="text-align:justify;"><strong>Reduction in Liability</strong> &#8211; Turning over this task to an expert also means a lot less worrying on your part.  All you have to do is make sure you are operating within a solid contract that protects you in the case of data loss.  Agree to a contract that puts you ahead in the case of a loss and you can sleep soundly knowing that your data is safe.</p>
<p style="text-align:justify;"><strong>Competition means Lower Prices Elsewhere as Well</strong> &#8211; Now that you are in a market where others are competing for your business, you&#8217;ll get to shop around and find the best deal in town.  In addition to the number one reason of lowering your overhead, competition also means that if you find you have gone with a company that doesn&#8217;t meet your needs you can switch.  Imagine making that mistake if you owned all your own equipment!</p>
<p style="text-align:justify;"><strong>More Effective Communication</strong> &#8211; If your company runs a database that needs to be accessed by multiple points, it will be easier for others to access and probably be faster for them to access as well.  Once again a good contract is key, but in most cases you can get more bandwidth access for your money by outsourcing, than you could by providing your own database connection.</p>
<p style="text-align:justify;"><strong>Better Security</strong> &#8211; On the other hand you will know your data is backed up by competition driven upgraded safeware.</p>
<p style="text-align:justify;"><strong>Standardization</strong> &#8211; What if your resource manager suddenly quits or is fired?  Outsourcing virtually guarantees that your information will be stored in a standard way, accessible consistently and without fear of security leaks.</p>
<p style="text-align:justify;"><strong>Cross-referencing with Third Party Information</strong> &#8211; In many cases it may be possible to have your information collated and cross-referenced with other information for a variety of needs.  Once again get a solid contract and fully understand your security requirements first.</p>
<p style="text-align:justify;"><strong>Removal of Duplicate or Incorrect Data</strong> &#8211; A final way outsourcing can help your database is a common option many companies will offer, which is the examination of your data in various ways as it is transferred.  Think of this as your businesses opportunity to &#8216;clean house,&#8217; and set out again with a fresh start.</p>
<p style="text-align:justify;">This post was contributed by <strong>Claire Webber</strong>, who writes about the <strong><a href="http://www.online-college-blog.com/">schools online</a></strong>. She welcomes your feedback at Claire.Webber1223 at gmail.com</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Database, DBA, Readers Contribution, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Outsourcing Technology <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4885/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4885/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4885/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4885/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4885/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4885/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4885/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4885/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4885/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4885/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4885&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/05/10/sql-server-10-reasons-for-database-outsourcing/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Introduction to JOINs &#8211; Basic of JOINs</title>
		<link>http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/</link>
		<comments>http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 01:30:02 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Joins]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL User Group]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4307</guid>
		<description><![CDATA[The launch of Gandhinagar SQL Server User Group was a tremendous, astonishing success! It was overwhelming to see a large gathering of enthusiasts looking up to me (I was the Key Speaker) eager to enhance their knowledge and participate in some brainstorming discussions.  Some members of User Group had requested me to write a simple [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4307&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">The launch of <strong><a href="http://blog.sqlauthority.com/2009/04/03/sqlauthority-news-launch-of-gandhinagar-sql-server-user-group/" target="_blank"><strong>Gandhinagar SQL Server User Group</strong></a></strong> was a tremendous, astonishing success! It was overwhelming to see a large gathering of enthusiasts looking up to me (I was the Key Speaker) eager to enhance their knowledge and participate in some brainstorming discussions.  Some members of User Group had requested me to write a simple article on JOINS elucidating its different types.</p>
<p style="text-align:justify;"><strong><a href="http://www.pinaldave.com/best-sql-server-download.cfm?download=EverythingJoin" target="_blank">Download SQL Script</a></strong> used throughout in this article to practice along. Now, take a quick look at the following two tables I have created.</p>
<h3 style="text-align:justify;"><strong>INNER JOIN</strong></h3>
<p style="text-align:justify;">This join returns rows when there is at least one match in both the tables.<br />
<img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/inner join.jpg" alt="" width="424" height="424" /></p>
<h3 style="text-align:justify;"><strong>OUTER JOIN</strong></h3>
</p>
<p style="text-align:justify;">
<p style="text-align:justify;">There are three different Outer Join methods.</p>
<p style="text-align:justify;"><strong>LEFT OUTER JOIN</strong><br />
This join returns all the rows from the left table in conjunction with the matching rows from the right table. If there are no columns matching in the right table, it returns NULL values.<br />
<img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/left join.jpg" alt="" width="424" height="424" /></p>
<p style="text-align:justify;"><strong>RIGHT OUTER JOIN</strong><br />
This join returns all the rows from the right table in conjunction with the matching rows from the left table. If there are no columns matching in the left table, it returns NULL values.<br />
<img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/right join.jpg" alt="" width="424" height="424" /></p>
<p style="text-align:justify;"><strong>FULL OUTER JOIN</strong><br />
This join combines left outer join and right after join. It returns row from either table when the conditions are met and returns null value when there is no match.<br />
<img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/outer join.jpg" alt="" width="424" height="424" /></p>
<h3 style="text-align:justify;">CROSS JOIN</h3>
</p>
<p style="text-align:justify;">
<p style="text-align:justify;">This join is a Cartesian join that does not necessitate any condition to join. The resultset contains records that are multiplication of record number from both the tables.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/cross join - half.jpg" alt="" width="500" height="444" /></p>
<h3 style="text-align:justify;">Additional Notes related to JOIN:</h3>
<p style="text-align:justify;">The following are three classic examples to display where Outer Join is useful. You will notice several instances where developers write query as given below.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">t1.ID </span><span style="color:gray;">NOT </span><span style="color:blue;">IN </span><span style="color:gray;">(</span><span style="color:blue;">SELECT </span><span style="color:black;">t2.ID </span><span style="color:blue;">FROM </span><span style="color:black;">Table2 t2</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code>
</p>
<p style="text-align:justify;">The query demonstrated above can be easily replaced by Outer Join. Indeed, replacing it by Outer Join is the best practice. The query that gives same result as above is displayed here using Outer Join and WHERE clause in join.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* LEFT JOIN - WHERE NULL */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:magenta;">LEFT </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">t2.ID </span><span style="color:blue;">IS </span><span style="color:gray;">NULL</span></code>
</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/left join null.jpg" alt="" width="424" height="424" /></p>
<p style="text-align:justify;">The above example can also be created using Right Outer Join.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/right join null.jpg" alt="" width="424" height="424" /></p>
<p style="text-align:justify;"><strong>NOT INNER JOIN</strong><br />
Remember, the term Not Inner Join does not exist in database terminology. However, when full Outer Join is used along with WHERE condition, as explained in the above two examples, it will give you exclusive result to Inner Join. This join will give all the results that were not present in Inner Join.
</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/march09ug/outer join null.jpg" alt="" width="424" height="424" /></p>
<p style="text-align:justify;">You can download the complete <strong><a href="http://www.pinaldave.com/best-sql-server-download.cfm?download=EverythingJoin" target="_blank">SQL Script</a></strong> here, but for the sake of complicity I am including the same script here.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks<br />
GO<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">table1<br />
</span><span style="color:gray;">(</span><span style="color:black;">ID </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:black;">Value </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">10</span><span style="color:gray;">))<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">Table1 </span><span style="color:gray;">(</span><span style="color:black;">ID</span><span style="color:gray;">, </span><span style="color:black;">Value</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">1</span><span style="color:gray;">,</span><span style="color:red;">'First'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">2</span><span style="color:gray;">,</span><span style="color:red;">'Second'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">3</span><span style="color:gray;">,</span><span style="color:red;">'Third'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">4</span><span style="color:gray;">,</span><span style="color:red;">'Fourth'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">5</span><span style="color:gray;">,</span><span style="color:red;">'Fifth'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">table2<br />
</span><span style="color:gray;">(</span><span style="color:black;">ID </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:black;">Value </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">10</span><span style="color:gray;">))<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">Table2 </span><span style="color:gray;">(</span><span style="color:black;">ID</span><span style="color:gray;">, </span><span style="color:black;">Value</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">1</span><span style="color:gray;">,</span><span style="color:red;">'First'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">2</span><span style="color:gray;">,</span><span style="color:red;">'Second'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">3</span><span style="color:gray;">,</span><span style="color:red;">'Third'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">6</span><span style="color:gray;">,</span><span style="color:red;">'Sixth'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">7</span><span style="color:gray;">,</span><span style="color:red;">'Seventh'<br />
</span><span style="color:blue;">UNION </span><span style="color:gray;">ALL<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">8</span><span style="color:gray;">,</span><span style="color:red;">'Eighth'<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table2<br />
GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks<br />
GO<br />
</span><span style="color:green;">/* INNER JOIN */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
GO<br />
</span><span style="color:green;">/* LEFT JOIN */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:magenta;">LEFT </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
GO<br />
</span><span style="color:green;">/* RIGHT JOIN */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:magenta;">RIGHT </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
GO<br />
</span><span style="color:green;">/* OUTER JOIN */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:blue;">FULL </span><span style="color:gray;">OUTER </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
GO<br />
</span><span style="color:green;">/* LEFT JOIN - WHERE NULL */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:magenta;">LEFT </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">t2.ID </span><span style="color:blue;">IS </span><span style="color:gray;">NULL<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">/* RIGHT JOIN - WHERE NULL */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:magenta;">RIGHT </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">t1.ID </span><span style="color:blue;">IS </span><span style="color:gray;">NULL<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">/* OUTER JOIN - WHERE NULL */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:blue;">FULL </span><span style="color:gray;">OUTER </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2 </span><span style="color:blue;">ON </span><span style="color:black;">t1.ID </span><span style="color:blue;">= </span><span style="color:black;">t2.ID<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">t1.ID </span><span style="color:blue;">IS </span><span style="color:gray;">NULL OR </span><span style="color:black;">t2.ID </span><span style="color:blue;">IS </span><span style="color:gray;">NULL<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">/* CROSS JOIN */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">t1.</span><span style="color:gray;">*,</span><span style="color:black;">t2.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Table1 t1<br />
</span><span style="color:gray;">CROSS </span><span style="color:blue;">JOIN </span><span style="color:black;">Table2 t2<br />
GO<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:black;">table1<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:black;">table2<br />
GO</span></code></p>
<p style="text-align:justify;"><span style="color:black;">I hope this article fulfills its purpose. I would like to have feedback from my blog readers.  Please suggest me where do you all want me to take this article next.<br />
</span>
</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
Posted in Best Practices, Database, Pinal Dave, SQL, SQL Authority, SQL Joins, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL User Group, SQLServer, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4307/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4307&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/march09ug/inner join.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/march09ug/left join.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/march09ug/right join.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/march09ug/outer join.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/march09ug/cross join - half.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/march09ug/left join null.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/march09ug/right join null.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/march09ug/outer join null.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; 2008 &#8211; Management Studio New Features</title>
		<link>http://blog.sqlauthority.com/2009/04/05/sql-server-2008-management-studio-new-features/</link>
		<comments>http://blog.sqlauthority.com/2009/04/05/sql-server-2008-management-studio-new-features/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 01:30:32 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Add-On]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4236</guid>
		<description><![CDATA[Pinalkumar Dave describes the top 5 features of SQL Server Management Studio 2008.
This article describes the top 5 features of SQL Server Management Studio 2008. With the release of SQL Server 2008 Microsoft has upgraded SSMS with many new features as well as added tons of new functionalities requested by DBAs for long time.
SQL Server [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4236&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><span>Pinalkumar Dave describes the top 5 features of SQL Server Management Studio 2008.</span></p>
<p style="text-align:justify;">This article describes the top 5 features of SQL Server Management Studio 2008. With the release of SQL Server 2008 Microsoft has upgraded SSMS with many new features as well as added tons of new functionalities requested by DBAs for long time.</p>
<p style="text-align:justify;">SQL Server 2008 has been released for a year now. In SQL Server 2000, DBA had to use two different tools to maintain the database as well as the query database, specifically SQL Server Enterprise Manager and SQL Server Query Analyzer. With the release of SQL Server 2005 both of these tools are combined into one tool: SQL Server Management Studio. For a while DBA who were fan of Query Analyzer requested to bring it back but as they keep on using SQL Server Management Studio (SSMS) they realized that it was much more convenient if every task related to SQL Server could be accomplished using SSMS. With the release of SQL Server 2008 Microsoft has upgraded SSMS with many new features as well as added tons of new functionalities requested by DBAs for long time.</p>
<p style="text-align:justify;">Let us go over a few of the important new features of the SSMS 2008. The list of SQL Server 2008 SSMS improvements is very long. I have selected my favorite 5 features and we will go over them.</p>
<ol style="text-align:justify;">
<li>IntelliSense for Query Editing</li>
<li>Multi Server Query</li>
<li>Query Editor Regions</li>
<li>Object Explorer Enhancements</li>
<li>Activity Monitors</li>
</ol>
<h3 style="text-align:center;"><a href="http://dotnetslackers.com/articles/sql/SQL-Server-2008-Management-Studio-New-Features.aspx" target="_blank">Read Complete article here.</a></h3>
Posted in Best Practices, Pinal Dave, SQL, SQL Add-On, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Server Management Studio, SQL Tips and Tricks, SQL Utility, SQLServer, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4236&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/05/sql-server-2008-management-studio-new-features/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Automated Index Defragmentation Script</title>
		<link>http://blog.sqlauthority.com/2009/04/04/sql-server-automated-index-defragmentation-script/</link>
		<comments>http://blog.sqlauthority.com/2009/04/04/sql-server-automated-index-defragmentation-script/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 01:30:57 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Contribution]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Index]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLAuthority Website Review]]></category>
		<category><![CDATA[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4232</guid>
		<description><![CDATA[Index Defragmentation is one of the key processes to significantly improve performance of any database. Index fragments occur when any transaction takes place in database table.  Fragmentation typically happens owing to insert, update and delete transactions. Having said that, fragmented data can produce unnecessary reads thereby reducing performance of heavy fragmented tables.
I have often been [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4232&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Index Defragmentation is one of the key processes to significantly improve performance of any database. Index fragments occur when any transaction takes place in database table.  Fragmentation typically happens owing to insert, update and delete transactions. Having said that, fragmented data can produce unnecessary reads thereby reducing performance of heavy fragmented tables.</p>
<p style="text-align:justify;">I have often been asked to share my personal Index Defragmentation Script. Well, I use Automated Index Defragmentation Script created by my friend &#8211; a SQL Expert &#8211; <strong><a href="http://sqlfool.com/about/" target="_blank">Michelle Ufford</a></strong> (a.k.a <strong>SQLFool</strong>). Michelle is a SQL Server Developer, DBA, a humble blogger, and an absolute geek! She is also the President of Eastern Iowa PASS Chapter, known as the I380 Corridor Professional Association of SQL Server. Currently, she is working with large, high volume, high performance SQL Server databases at GoDaddy.com. Her nickname might be SQLFool but honestly speaking, she is one of the best Gurus of SQL.  You can read her  <strong><a href="http://sqlfool.com/" target="_blank">blog </a></strong>here.</p>
<p style="text-align:justify;">Michelle has written an excellent article about Automated Index Defragmentation Script. I recommend this wonderful write-up to all those database developers who are searching for a good solution to improve database performance. Read her article <strong><a href="http://sqlfool.com/2009/03/automated-index-defrag-script/" target="_blank">Automated Index Defragmentation Script</a></strong> to equip yourself with better understanding on how to improve database performance.</p>
<p style="text-align:justify;">Here, I would to mention an interesting question taken from the above-mentioned article, which will clearly show how powerful this Automated Index Defragmentation Script is.</p>
<p style="text-align:justify;"><strong>How long will this Automated Index Defragmentation Script  take to run?</strong><br />
Well, it depends. I don’t necessarily recommend running it without specifying a database; at least, not unmonitored. You *can* do that, but it could take a while. For example, to run sys.dm_db_index_physical_stats for all databases and tables, totaling 2TB, took me 4.5 hours; that doesn’t even count the actual defrags.
</p>
<p style="text-align:justify;">You can <strong><a href="http://sqlfool.com/scripts/dba_indexDefrag_sp.txt" target="_blank">download the script</a></strong> from here.</p>
<p style="text-align:justify;">Please feel free to contact Michelle or me if you have any questions and doubts regarding this script.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (</strong><a href="http://blog.sqlauthority.com/" target="_blank"><strong>http://blog.SQLAuthority.com</strong></a><strong>)</strong></p>
<p style="text-align:justify;">
Posted in Best Practices, Database, Pinal Dave, Readers Contribution, SQL, SQL Authority, SQL Index, SQL Optimization, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQLAuthority Website Review, SQLServer, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4232/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4232&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/04/sql-server-automated-index-defragmentation-script/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQLAuthority News &#8211; Top 10 Strategic Technologies for 2009</title>
		<link>http://blog.sqlauthority.com/2009/03/30/sqlauthority-news-top-10-strategic-technologies-for-2009/</link>
		<comments>http://blog.sqlauthority.com/2009/03/30/sqlauthority-news-top-10-strategic-technologies-for-2009/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 01:30:50 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Documentation]]></category>
		<category><![CDATA[SQL Download]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[SQLAuthority Website Review]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4103</guid>
		<description><![CDATA[Gartner, Inc. analysts highlighted the top 10 technologies and trends that will be strategic for most organizations. Factors that denote significant impact include a high potential for disruption to IT or the business, the need for a major dollar investment, or the risk of being late to adopt.
The top 10 strategic technologies for 2009 include:
Virtualization. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4103&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><a href="http://www.gartner.com/it/page.jsp?id=777212" target="_blank">Gartner, Inc.</a> analysts highlighted the top 10 technologies and trends that will be strategic for most organizations. Factors that denote significant impact include a high potential for disruption to IT or the business, the need for a major dollar investment, or the risk of being late to adopt.</p>
<p style="text-align:justify;">The top 10 strategic technologies for 2009 include:</p>
<p style="text-align:justify;"><strong>Virtualization.</strong> Much of the current buzz is focused on server virtualization, but virtualization in storage and client devices is also moving rapidly.</p>
<p style="text-align:justify;"><strong>Cloud Computing.</strong> Cloud computing is a style of computing that characterizes a model in which providers deliver a variety of IT-enabled capabilities to consumers</p>
<p style="text-align:justify;"><strong>Servers</strong> &#8211; <strong>Beyond Blades.</strong> Servers are evolving beyond the blade server stage that exists today. This evolution will simplify the provisioning of capacity to meet growing needs.</p>
<p style="text-align:justify;"><strong>Web-Oriented Architectures.</strong> The Internet is arguably the best example of an agile, interoperable and scalable service-oriented environment in existence.</p>
<p style="text-align:justify;"><strong>EnterpriseMashups.</strong> Enterprises are now investigating taking mashups from cool Web hobby to enterprise-class systems to augment their models for delivering and managing applications.</p>
<p style="text-align:justify;"><strong>Specialized Systems.</strong> Appliances have been used to accomplish IT purposes, but only with a few classes of function have appliances prevailed.</p>
<p style="text-align:justify;"><strong>Social Software and Social Networking.</strong> Social software includes a broad range of technologies, such as social networking, social collaboration, social media and social validation.</p>
<p style="text-align:justify;"><strong>Unified Communications.</strong> During the next five years, the number of different communications vendors with which a typical organization works with will be reduced by at least 50 percent.</p>
<p style="text-align:justify;"><strong>Business Intelligence.</strong> Business Intelligence (BI) have a direct positive impact on a company&#8217;s business performance, dramatically improving its ability to accomplish its mission by making smarter decisions at every level of the business from corporate strategy to operational processes.</p>
<p style="text-align:justify;"><strong>Green IT.</strong> Shifting to more efficient products and approaches can allow for more equipment to fit within an energy footprint, or to fit into a previously filled center.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>),</strong> Gartner Inc.(Published after receiving permission)</p>
Posted in Best Practices, Software Development, SQL, SQL Authority, SQL Documentation, SQL Download, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, SQLAuthority Website Review, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/4103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/4103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/4103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/4103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/4103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/4103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/4103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/4103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/4103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/4103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=4103&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/03/30/sqlauthority-news-top-10-strategic-technologies-for-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; 2008 &#8211; Optimize for Ad hoc Workloads &#8211; Advance Performance Optimization</title>
		<link>http://blog.sqlauthority.com/2009/03/21/sql-server-2008-optimize-for-ad-hoc-workloads-advance-performance-optimization/</link>
		<comments>http://blog.sqlauthority.com/2009/03/21/sql-server-2008-optimize-for-ad-hoc-workloads-advance-performance-optimization/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 01:30:44 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Optimization]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Stored Procedure]]></category>
		<category><![CDATA[SQL System Table]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3819</guid>
		<description><![CDATA[Every batch (T-SQL, SP etc) when ran creates execution plan which is stored in system for re-use. Due to this reason large number of query plans are stored in system. However, there are plenty of plans which are only used once and have never re-used again. One time ran batch plans wastes memory and resources.
SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3819&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Every batch (T-SQL, SP etc) when ran creates execution plan which is stored in system for re-use. Due to this reason large number of query plans are stored in system. However, there are plenty of plans which are only used once and have never re-used again. One time ran batch plans wastes memory and resources.</p>
<p style="text-align:justify;">SQL Server 2008 has feature of optimizing ad hoc workloads. Before we move to it, let us understand the behavior of SQL Server without optimizing ad hoc workload.</p>
<p style="text-align:justify;">Please run following script for testing. Make sure to not to run whole batch together. Just run each command separately to really see the effect of subject of article.</p>
<p style="text-align:justify;"><a href="http://www.pinaldave.com/bimg/CachePlan.zip" target="_blank"><strong>Download complete script of this article here.</strong></a></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* Test 0 */<br />
/* Clean Cache and Buffers */<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">FREEPROCCACHE<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">DROPCLEANBUFFERS<br />
GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks<br />
GO<br />
</span><span style="color:green;">/* Run Adhoc Query First Time */<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Shift<br />
GO<br />
</span><span style="color:green;">/* Check if Adhoc query is cached.<br />
It will return one result */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">usecounts</span><span style="color:gray;">, </span><span style="color:black;">cacheobjtype</span><span style="color:gray;">, </span><span style="color:black;">objtype</span><span style="color:gray;">, </span><span style="color:blue;">TEXT<br />
FROM </span><span style="color:black;">sys.dm_exec_cached_plans<br />
</span><span style="color:gray;">CROSS </span><span style="color:black;">APPLY sys.dm_exec_sql_text</span><span style="color:gray;">(</span><span style="color:black;">plan_handle</span><span style="color:gray;">)<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">usecounts </span><span style="color:gray;">&gt; </span><span style="color:black;">0 </span><span style="color:gray;">AND<br />
</span><span style="color:blue;">TEXT </span><span style="color:gray;">LIKE </span><span style="color:red;">'%SELECT * FROM HumanResources.Shift%'<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">usecounts </span><span style="color:blue;">DESC</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code>
</p>
<p style="text-align:justify;">Now let us check result of this script. It is clear from result that when we ran query once it cached its plan in memory. If we never run this again in future or if we have just ran as part of building longer query the cache plan of this query is just waste of memory.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/cachetest0.jpg" alt="" width="553" height="516" /></p>
<p style="text-align:justify;">Let us now enable the option of optimizing ad hoc workload. This feature is available in all the versions of SQL Server 2008.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:black;"> </span><span style="color:darkred;">sp_CONFIGURE </span><span style="color:red;">'show advanced options'</span><span style="color:gray;">,</span><span style="color:black;">1<br />
</span><span style="color:blue;">RECONFIGURE<br />
</span><span style="color:black;">GO</span></code></p>
<p><span style="color:darkred;">sp_CONFIGURE </span><span style="color:red;">&#8216;optimize for ad hoc workloads&#8217;</span><span style="color:gray;">,</span><span style="color:black;">1<br />
</span><span style="color:blue;">RECONFIGURE<br />
</span><span style="color:black;">GO</span>
</p>
<p style="text-align:justify;">We will now run the code for Test 1 which is almost same as Test 0. Make sure to clean the cache and buffer before running the query to create real life scenario of live case.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* Test 1 */<br />
/* Clean Cache and Buffers */<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">FREEPROCCACHE<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">DROPCLEANBUFFERS<br />
GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks<br />
GO<br />
</span><span style="color:green;">/* Run Adhoc Query First Time */<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Shift<br />
GO<br />
</span><span style="color:green;">/* Check if Adhoc query is cached.<br />
It will not return any result */<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">usecounts</span><span style="color:gray;">, </span><span style="color:black;">cacheobjtype</span><span style="color:gray;">, </span><span style="color:black;">objtype</span><span style="color:gray;">, </span><span style="color:blue;">TEXT<br />
FROM </span><span style="color:black;">sys.dm_exec_cached_plans<br />
</span><span style="color:gray;">CROSS </span><span style="color:black;">APPLY sys.dm_exec_sql_text</span><span style="color:gray;">(</span><span style="color:black;">plan_handle</span><span style="color:gray;">)<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">usecounts </span><span style="color:gray;">&gt; </span><span style="color:black;">0 </span><span style="color:gray;">AND<br />
</span><span style="color:blue;">TEXT </span><span style="color:gray;">LIKE </span><span style="color:red;">'SELECT * FROM HumanResources.Shift%'<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">usecounts </span><span style="color:blue;">DESC</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO </span></code>
</p>
<p style="text-align:justify;">We can clear see now as we have advance option enabled we do not have query cache planed stored in database.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/cachetest1.jpg" alt="" width="556" height="485" /></p>
<p style="text-align:justify;">We are interested to know now that if we run the batch more than 1 time it will cache its execution plan.  With advance option of optimizing ad hoc workload.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:green;">/* Test 2 */<br />
/* Clean Cache and Buffers */<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">FREEPROCCACHE<br />
</span><span style="color:blue;">DBCC </span><span style="color:black;">DROPCLEANBUFFERS<br />
GO<br />
</span><span style="color:green;">/* Run Adhoc Query two  Time */<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Shift<br />
GO 5<br />
</span><span style="color:green;">/* Check if Adhoc query is cached.<br />
It will return result with Adhoc Query ran two times*/<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">usecounts</span><span style="color:gray;">, </span><span style="color:black;">cacheobjtype</span><span style="color:gray;">, </span><span style="color:black;">objtype</span><span style="color:gray;">, </span><span style="color:blue;">TEXT<br />
FROM </span><span style="color:black;">sys.dm_exec_cached_plans<br />
</span><span style="color:gray;">CROSS </span><span style="color:black;">APPLY sys.dm_exec_sql_text</span><span style="color:gray;">(</span><span style="color:black;">plan_handle</span><span style="color:gray;">)<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">usecounts </span><span style="color:gray;">&gt; </span><span style="color:black;">0 </span><span style="color:gray;">AND<br />
</span><span style="color:blue;">TEXT </span><span style="color:gray;">LIKE </span><span style="color:red;">'%SELECT * FROM HumanResources.Shift%'<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">usecounts </span><span style="color:blue;">DESC</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code>
</p>
<p style="text-align:justify;">From our image it is quite clear that when the batch is ran for more than 1 time it caches its execution plan. This is generic behavior with or without turning on advance option.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/cachetest2.jpg" alt="" width="561" height="859" /></p>
<p style="text-align:justify;">This may be very simple to see from the top but if you are using SQL Server 2008 and have millions of ad hoc query running every day you wil realize how important this feature is. This feature improves performance by relieving memory pressure by not storing the single time used compiled plans.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Optimization, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Stored Procedure, SQL System Table, SQL Tips and Tricks, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/3819/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/3819/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/3819/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/3819/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/3819/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/3819/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/3819/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/3819/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/3819/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/3819/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3819&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/03/21/sql-server-2008-optimize-for-ad-hoc-workloads-advance-performance-optimization/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/cachetest0.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/cachetest1.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/cachetest2.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; AWE (Address Windowing Extensions) Explained in Simple Words</title>
		<link>http://blog.sqlauthority.com/2009/03/20/sql-server-awe-address-windowing-extensions-explained-in-simple-words/</link>
		<comments>http://blog.sqlauthority.com/2009/03/20/sql-server-awe-address-windowing-extensions-explained-in-simple-words/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 01:30:19 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Add-On]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Performance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Memory]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3811</guid>
		<description><![CDATA[I was asked question by Jr. DBA that &#8220;What is AWE?&#8221;. For those who do know what is AWE or where is it located, it can be found at SQL Server Level properties. AWE is properly explained in BOL so we will just have our simple explanation. 



Address Windowing Extensions API is commonly known as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3811&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I was asked question by Jr. DBA that <strong>&#8220;What is AWE?&#8221;.</strong> For those who do know what is AWE or where is it located, it can be found at SQL Server Level properties. AWE is properly explained in BOL so we will just have our simple explanation. <strong><br />
</strong>
</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/awe.jpg" alt="" width="500" height="449" /></p>
<p style="text-align:justify;">Address Windowing Extensions API is commonly known as AWE.  AWE is used by SQL Server when it has to support very large amounts of physical memory. AWE feature is only available in SQL Server Enterprise, Standard, and Developer editions with of SQL Server 32 bit version.</p>
<p style="text-align:justify;"><strong>Microsoft Windows 2000/2003 server supports maximum of 64GB memory. If we have installed SQL Server 32 bit version which can support maximum of 3 GB memory on Windows 2000/2003, we can enable AWE feature to use available physical memory of server to improve performance of SQL Server. In simple words, AWE provides memory management functions which lets windows to allow more than 3GB memory to standard 32 bit application. </strong></p>
<p style="text-align:justify;">There are many other modification needs to be done before AWE option can be used. Please refer SQL Server BOL <a href="http://technet.microsoft.com/en-us/library/ms175581.aspx" target="_blank">Using AWE</a> for additional details.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com" target="_blank">http://blog.sqlauthority.com</a>)<br />
</strong></p>
Posted in Best Practices, Database, Pinal Dave, SQL, SQL Add-On, SQL Authority, SQL Performance, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Memory <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/3811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/3811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/3811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/3811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/3811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/3811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/3811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/3811/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/3811/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/3811/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3811&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/03/20/sql-server-awe-address-windowing-extensions-explained-in-simple-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/awe.jpg" medium="image" />
	</item>
		<item>
		<title>SQLAuthority News &#8211; 900th Article &#8211; 9 Best Practices &#8211; Important Milestones</title>
		<link>http://blog.sqlauthority.com/2009/03/19/sqlauthority-news-900th-article-9-best-practices-important-milestones/</link>
		<comments>http://blog.sqlauthority.com/2009/03/19/sqlauthority-news-900th-article-9-best-practices-important-milestones/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 01:30:45 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[About Me]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQLAuthority News]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3796</guid>
		<description><![CDATA[Today is my 900th article on this blog. You can see list of all the 900 articles here. I suggest you go over the list and read any article you like.
First let us go over 9 Best Practices List.

Auto Shrink runs at regular interval (30 mins) in background of SQL Server and it is cause [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3796&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Today is my 900th article on this blog. You can see list of all the <strong><a href="http://blog.sqlauthority.com/best_top_sql_server_blog_all_post/" target="_blank">900 articles</a></strong> here. I suggest you go over<strong> <a href="http://blog.sqlauthority.com/best_top_sql_server_blog_all_post/" target="_blank">the list</a></strong> and read any article you like.</p>
<p style="text-align:justify;">First let us go over <strong>9 Best Practices</strong> List.</p>
<ol style="text-align:justify;">
<li>Auto Shrink runs at regular interval (30 mins) in background of SQL Server and it is cause performance dropping fragmentation. It should be turn off.</li>
<li>All the statistics should be updated at regular interval.</li>
<li>Compressed backup should be used instead of regular backup as it improves speed and performance. Restoring compressed backup is faster than regular restore.</li>
<li>Always take full database backups along with differential and log backups. Log backups can be very much useful for point-in-time recovery.</li>
<li>Pay attention to &#8220;Activity Monitor&#8221; &#8211; a new feature which displays current activity of a) Process Time, b) Waiting Tasks, c) Database I/O, d) Batch Requests/Sec.</li>
<li>Control the configurations as well enforces policies using Policy Based Management.</li>
<li>Utilize new datatypes DATE and TIME instead of conventional DATETIME.</li>
<li>Keep database updated with latest SPs and Cumulative Updates.</li>
<li>Use Dynamic Management Views to figure out longest running queries as well most popular queries.</li>
</ol>
<p style="text-align:justify;">I really had great time at<strong> <a href="http://blog.sqlauthority.com/2009/03/09/sqlauthority-news-author-visit-complete-wrapup-of-microsoft-mvp-summit-2009-trip/" target="_blank">Microsoft MVP Summit 2009</a></strong> at Seattle, you can read about my trip to Seattle <a href="http://blog.sqlauthority.com/2009/03/09/sqlauthority-news-author-visit-complete-wrapup-of-microsoft-mvp-summit-2009-trip/" target="_blank">here</a>. I have recently updated my <a href="http://blog.sqlauthority.com/database-administrator-mcdba-resume/" target="_blank"><strong>resume</strong> </a>with my latest activities.</p>
<p style="text-align:justify;">Social Media is new thing and I am really enjoying to be part of it. Twitter, LinkedIn, Facebook, Feedreader are my latest interests. Here is my web presence in social media.</p>
<p style="text-align:left;"><strong>Twitter:</strong> <a href="http://twitter.com/pinaldave" target="_blank">http://twitter.com/pinaldave</a><br />
<strong>Facebook:</strong> <a href="http://www.facebook.com/home.php#/profile.php?id=654862451" target="_blank">http://www.facebook.com/home.php#/profile.php?id=654862451</a><br />
<strong>LinkedIn:</strong> <a href="http://www.linkedin.com/in/pinaldave" target="_blank">http://www.linkedin.com/in/pinaldave</a><br />
<strong>SQLAuthority Feed:</strong> <a href="http://feeds2.feedburner.com/SQLAuthority" target="_blank">http://feeds2.feedburner.com/SQLAuthority</a><br />
<strong>SQLAuthority Email:</strong> <a href="http://www.feedburner.com/fb/a/emailverifySubmit?feedId=872428" target="_blank">http://www.feedburner.com/fb/a/emailverifySubmit?feedId=872428</a></p>
<p style="text-align:left;"><strong>Search@SQLAuthority:</strong> <a href="http://search.sqlauthority.com/" target="_blank">http://search.sqlauthority.com/</a><br />
<strong>Job@SQLAuthority:</strong> <a href="http://jobs.sqlauthority.com" target="_blank">http://jobs.sqlauthority.com</a><br />
<strong>Resume:</strong> <a href="http://blog.sqlauthority.com/database-administrator-mcdba-resume/" target="_blank">http://blog.sqlauthority.com/database-administrator-mcdba-resume/</a>
</p>
<p style="text-align:justify;">You can <a href="http://blog.sqlauthority.com/hire-me/" target="_blank">hire me</a> through my company, read the details of here.</p>
<p style="text-align:justify;">Best thing about my job is I can work from office as well as from home office. Find me in action at home office.</p>
<p style="text-align:justify;">
<div class="wp-caption alignnone" style="width: 510px"><img title="Pinal at Home Office" src="http://www.pinaldave.com/bimg/PinalAtWork.JPG" alt="Pinal at Home Office" width="500" height="375" /><p class="wp-caption-text">Pinal at Home Office</p></div>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.SQLAuthority.com" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in About Me, Best Practices, Database, DBA, Pinal Dave, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/3796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/3796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/3796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/3796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/3796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/3796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/3796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/3796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/3796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/3796/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3796&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/03/19/sqlauthority-news-900th-article-9-best-practices-important-milestones/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/PinalAtWork.JPG" medium="image">
			<media:title type="html">Pinal at Home Office</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; UDF &#8211; Pad Ride Side of Number with 0 &#8211; Fixed Width Number Display</title>
		<link>http://blog.sqlauthority.com/2009/03/16/sql-server-udf-pad-ride-side-of-number-with-0-fixed-width-number-display/</link>
		<comments>http://blog.sqlauthority.com/2009/03/16/sql-server-udf-pad-ride-side-of-number-with-0-fixed-width-number-display/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 01:30:42 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Contribution]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Function]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3764</guid>
		<description><![CDATA[I had written article SQL SERVER &#8211; Pad Ride Side of Number with 0 &#8211; Fixed Width Number Display few days ago. Previous article was answer to the email which I had received:
Dear Pinal,
I have situation where I need to display my numbers in fixed format. Like
1 as 0000001
109 as 0000109
0987 as 0000987

Is there any [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3764&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">I had written article <strong><a href="http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/" target="_blank">SQL SERVER &#8211; Pad Ride Side of Number with 0 &#8211; Fixed Width Number Display</a></strong> few days ago. Previous article was answer to the email which I had received:</p>
<p style="padding-left:30px;text-align:justify;"><em>Dear Pinal,</em></p>
<p style="padding-left:30px;text-align:justify;"><em>I have situation where I need to display my numbers in fixed format. Like</em></p>
<p style="padding-left:30px;text-align:justify;"><strong><em>1 as 0000001<br />
109 as 0000109</em><em><br />
0987 as 0000987</em></strong>
</p>
<p style="padding-left:30px;text-align:justify;"><em>Is there any string function in SQL Server which can do this?</em></p>
<p style="text-align:justify;">I had asked my blog readers to participate at the end of the article and I have received three very good suggestions. I am going to list all the three suggestions here. For me all the three suggestions are equally good. I suggest my readers to use any suggestion which they find easy to understand. I suggest to read my <a href="http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/" target="_blank">previous article</a> before continuing this article further.</p>
<p style="text-align:justify;"><strong>Solution 1 by <a href="http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/#comment-48722" target="_blank">Imran Mohammed</a></strong></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE FUNCTION </span><span style="color:black;">dbo.FnExample<br />
</span><span style="color:gray;">(<br />
</span><span style="color:#434343;">@Size </span><span style="color:blue;">INT</span><span style="color:gray;">,<br />
</span><span style="color:#434343;">@Column_Value </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:blue;">MAX</span><span style="color:gray;">)<br />
)<br />
</span><span style="color:blue;">RETURNS TABLE<br />
AS<br />
RETURN<br />
</span><span style="color:gray;">(<br />
</span><span style="color:green;">-- Add the SELECT statement with parameter references here<br />
</span><span style="color:blue;">SELECT </span><span style="color:magenta;">RIGHT</span><span style="color:gray;">(</span><span style="color:magenta;">REPLICATE</span><span style="color:gray;">(</span><span style="color:black;">0</span><span style="color:gray;">, </span><span style="color:#434343;">@Size</span><span style="color:gray;">)<br />
+ </span><span style="color:magenta;">CONVERT </span><span style="color:gray;">(</span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:blue;">MAX</span><span style="color:gray;">), </span><span style="color:#434343;">@Column_Value</span><span style="color:gray;">), </span><span style="color:#434343;">@Size</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">ID<br />
</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Run following script to see output<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">dbo.FnExample </span><span style="color:gray;">(</span><span style="color:black;">7</span><span style="color:gray;">, </span><span style="color:black;">123</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code>
</p>
<p style="text-align:justify;"><strong>Solution 2 by <a href="http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/#comment-48725" target="_blank">Fenil Desai</a></strong></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE FUNCTION </span><span style="color:black;">[dbo].[f_pad_before]<br />
</span><span style="color:gray;">( </span><span style="color:#434343;">@string </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">255</span><span style="color:gray;">),<br />
</span><span style="color:#434343;">@desired_length </span><span style="color:black;">INTEGER</span><span style="color:gray;">,<br />
</span><span style="color:#434343;">@pad_character </span><span style="color:blue;">CHAR</span><span style="color:gray;">(</span><span style="color:black;">1</span><span style="color:gray;">))<br />
</span><span style="color:blue;">RETURNS VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">255</span><span style="color:gray;">) </span><span style="color:blue;">AS<br />
BEGIN<br />
</span><span style="color:green;">/* Prefix the required number of spaces to bulk up the string and<br />
then replace the spaces with the desired character */<br />
</span><span style="color:blue;">RETURN </span><span style="color:magenta;">LTRIM</span><span style="color:gray;">(</span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(<br />
</span><span style="color:magenta;">CASE<br />
</span><span style="color:blue;">WHEN </span><span style="color:magenta;">LEN</span><span style="color:gray;">(</span><span style="color:#434343;">@string</span><span style="color:gray;">) &lt; </span><span style="color:#434343;">@desired_length<br />
</span><span style="color:blue;">THEN </span><span style="color:magenta;">REPLACE</span><span style="color:gray;">(</span><span style="color:magenta;">SPACE</span><span style="color:gray;">(</span><span style="color:#434343;">@desired_length </span><span style="color:gray;">- </span><span style="color:magenta;">LEN</span><span style="color:gray;">(</span><span style="color:#434343;">@string</span><span style="color:gray;">)), </span><span style="color:red;">' '</span><span style="color:gray;">, </span><span style="color:#434343;">@pad_character</span><span style="color:gray;">) + </span><span style="color:#434343;">@string<br />
</span><span style="color:blue;">ELSE </span><span style="color:#434343;">@string<br />
</span><span style="color:blue;">END<br />
</span><span style="color:gray;">))<br />
</span><span style="color:blue;">END<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Run following script to see output<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">dbo.f_pad_before</span><span style="color:gray;">(</span><span style="color:red;">'123'</span><span style="color:gray;">,</span><span style="color:black;">7</span><span style="color:gray;">,</span><span style="color:red;">'0'</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p><strong>Solution 3 by <a href="http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/#comment-48766" target="_blank">CodeMonkey</a></strong></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE FUNCTION </span><span style="color:black;">dbo.PadLeft<br />
</span><span style="color:gray;">(</span><span style="color:#434343;">@Value </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:#434343;">@PadWidth </span><span style="color:blue;">INT</span><span style="color:gray;">, </span><span style="color:#434343;">@PadChar </span><span style="color:blue;">CHAR</span><span style="color:gray;">(</span><span style="color:black;">1</span><span style="color:gray;">))<br />
</span><span style="color:blue;">RETURNS VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">255</span><span style="color:gray;">)<br />
</span><span style="color:blue;">AS<br />
BEGIN<br />
RETURN </span><span style="color:magenta;">ISNULL</span><span style="color:gray;">(</span><span style="color:magenta;">REPLICATE</span><span style="color:gray;">(</span><span style="color:#434343;">@PadChar</span><span style="color:gray;">, </span><span style="color:#434343;">@PadWidth </span><span style="color:gray;">- </span><span style="color:magenta;">LEN</span><span style="color:gray;">(</span><span style="color:#434343;">@Value</span><span style="color:gray;">)), </span><span style="color:red;">''</span><span style="color:gray;">)<br />
+ </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:#434343;">@Value </span><span style="color:blue;">AS VARCHAR</span><span style="color:gray;">)<br />
</span><span style="color:blue;">END<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Run following script to see output<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">dbo.PadLeft</span><span style="color:gray;">(</span><span style="color:black;">123</span><span style="color:gray;">,</span><span style="color:black;">7</span><span style="color:gray;">,</span><span style="color:black;">0</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code>
</p>
<p style="text-align:justify;">Answer of all of the above script will be <strong>&#8216;0000123&#8242;</strong>.</p>
<p style="text-align:justify;">Again, I want to congratulate all three of my reader to participate in this interesting puzzle and would like to encourage other readers to participate in similar puzzles like this.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in Best Practices, Pinal Dave, Readers Contribution, SQL, SQL Authority, SQL Function, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/3764/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/3764/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/3764/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/3764/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/3764/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/3764/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/3764/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/3764/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/3764/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/3764/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3764&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/03/16/sql-server-udf-pad-ride-side-of-number-with-0-fixed-width-number-display/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL SERVER &#8211; Pad Ride Side of Number with 0 &#8211; Fixed Width Number Display</title>
		<link>http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/</link>
		<comments>http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 01:30:32 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Function]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Scripts]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Tips and Tricks]]></category>
		<category><![CDATA[SQL Utility]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3719</guid>
		<description><![CDATA[Today we will look something which is very quick and but quite frequently useful string operation over numeric datatype. This article is written based on question asked by one of the user (name not disclosed as per request).
Email was received as following:
Dear Pinal,
I have situation where I need to display my numbers in fixed format. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3719&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;">Today we will look something which is very quick and but quite frequently useful string operation over numeric datatype. This article is written based on question asked by one of the user (name not disclosed as per request).</p>
<p style="text-align:justify;">Email was received as following:</p>
<p style="padding-left:30px;text-align:justify;"><em>Dear Pinal,</em></p>
<p style="padding-left:30px;text-align:justify;"><em>I have situation where I need to display my numbers in fixed format. Like</em></p>
<p style="padding-left:30px;text-align:justify;"><strong><em>1 as 0000001<br />
109 as 0000109</em><em><br />
0987 as 0000987</em></strong>
</p>
<p style="padding-left:30px;text-align:justify;"><em>Is there any string function in SQL Server which can do this?</em></p>
<p style="text-align:justify;">There is no ready made function in SQL Server which offers this solution but we can quickly write up something very simple. I have use AdventureWorks database for our example purpose. I have noticed that some developers does not use CAST function but I strongly suggest to use it as if CAST function is not used and your column is of numeric datatype it will give errors.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks<br />
GO<br />
</span><span style="color:blue;">SELECT TOP </span><span style="color:black;">10 ContactID<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Person.Contact<br />
GO<br />
</span><span style="color:green;">/* Method 1 Using RIGHT function*/<br />
</span><span style="color:blue;">SELECT TOP </span><span style="color:black;">10 </span><span style="color:magenta;">RIGHT</span><span style="color:gray;">(</span><span style="color:red;">'0000000'<br />
</span><span style="color:gray;">+ </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:black;">ContactID </span><span style="color:blue;">AS VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">7</span><span style="color:gray;">)), </span><span style="color:black;">7</span><span style="color:gray;">) </span><span style="color:black;">PaddedContactID<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Person.Contact<br />
GO<br />
</span><span style="color:green;">/* Method 2 Using RIGHT AND REPLICATE function*/<br />
</span><span style="color:blue;">SELECT TOP </span><span style="color:black;">10 </span><span style="color:magenta;">RIGHT</span><span style="color:gray;">(</span><span style="color:magenta;">REPLICATE</span><span style="color:gray;">(</span><span style="color:red;">'0'</span><span style="color:gray;">, </span><span style="color:black;">7</span><span style="color:gray;">)<br />
+ </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:black;">ContactID </span><span style="color:blue;">AS VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">7</span><span style="color:gray;">)), </span><span style="color:black;">7</span><span style="color:gray;">) </span><span style="color:black;">PaddedContactID<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">Person.Contact<br />
GO</span></code>
</p>
<p style="text-align:justify;">Following image demonstrates the result of above two methods.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/pading0.jpg" alt="" width="500" height="772" /></p>
<p style="text-align:justify;">If you prefer you can create UDF for the same. I would encourage my readers to submit the UDF for satisfying following criteria using code provided above.<br />
UDF should take a parameter &#8216;Total Width of Number (in our example it is 7).
</p>
<p style="text-align:justify;">I will publish the reader who posts first correct answer to this UDF on this blog with due credit.</p>
<p style="text-align:justify;">Reference : <strong>Pinal Dave (<a href="http://blog.SQLAuthority.com" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
Posted in Best Practices, Pinal Dave, Readers Question, SQL, SQL Authority, SQL Function, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/3719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/3719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/3719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/3719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/3719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/3719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/3719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/3719/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/3719/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/3719/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=3719&subd=sqlauthority&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/03/10/sql-server-pad-ride-side-of-number-with-0-fixed-width-number-display/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&#38;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content>

		<media:content url="http://www.pinaldave.com/bimg/pading0.jpg" medium="image" />
	</item>
	</channel>
</rss>