<?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>Sun, 21 Mar 2010 01:30:28 +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://s2.wp.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>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.sqlauthority.com/osd.xml" title="Journey to SQL Authority with Pinal Dave" />
	<atom:link rel='hub' href='http://blog.sqlauthority.com/?pushpress=hub'/>
		<item>
		<title>SQL SERVER- IF EXISTS(Select null from table) vs IF EXISTS(Select 1 from table)</title>
		<link>http://blog.sqlauthority.com/2010/02/21/sql-server-if-existsselect-null-from-table-vs-if-existsselect-1-from-table/</link>
		<comments>http://blog.sqlauthority.com/2010/02/21/sql-server-if-existsselect-null-from-table-vs-if-existsselect-1-from-table/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 01:30:43 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[Readers Contribution]]></category>
		<category><![CDATA[Readers Question]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></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[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=8029</guid>
		<description><![CDATA[Few days ago I wrote article about SQL SERVER – Stored Procedure Optimization Tips – Best Practices. I received lots of comments on particular blog article. In fact, almost all the comments are very interesting. If you have not read all the comments, I strongly suggest to read them. Click here to read the comments.
The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=8029&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Few days ago I wrote article about <strong><a href="http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/" target="_blank">SQL SERVER – Stored Procedure Optimization Tips – Best Practices</a></strong>. I received lots of comments on particular blog article. In fact, almost all the comments are very interesting. If you have not read all the comments, I strongly suggest to read them. Click here to read the comments.</p>
<p style="text-align:justify;">The most interesting comment conversation is among Divya, Brian and Marko. Please read the comments of Marko for sure. It is the comment, which has triggered this post.</p>
<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/#comment-61425" target="_blank">Comments by Divya</a></strong></p>
<p style="padding-left:30px;text-align:justify;">I have seen in one of the blogs to use EXISTS like</p>
<p style="padding-left:30px;text-align:justify;">IF EXISTS(Select null from table)</p>
<p style="padding-left:30px;text-align:justify;">Will it optimize the perfomance better than</p>
<p style="padding-left:30px;text-align:justify;">IF EXISTS(Select 1 from table)?</p>
<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/#comment-61482" target="_blank">Comments by Brian Tkatch</a></strong></p>
<p style="text-align:justify;">@Divya</p>
<p style="padding-left:30px;text-align:justify;">It makes no difference what is put there.</p>
<p style="padding-left:30px;text-align:justify;">Brad Schulz has an interest article on it: http://bradsruminations.blogspot.com/2009/09/age-old-select-vs-select-1-debate.html</p>
<p style="padding-left:30px;text-align:justify;">Even 1/0 is allowed! Obviously, it is not evaluated.</p>
<p style="padding-left:30px;text-align:justify;">Technically, however, * does get expanded, adding some minuscule amount of time: http://www.sqlskills.com/BLOGS/CONOR/2008/02/default.aspx?page=2</p>
<p style="padding-left:30px;text-align:justify;">So, anything other than * takes the same amount of time. * takes an iota longer. Personally, i use *, to show that i do not care what the results are.</p>
<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/#comment-61485" target="_blank">Comments by Pinal Dave</a></strong></p>
<p style="padding-left:30px;text-align:justify;">Hello Divya,</p>
<p style="padding-left:30px;text-align:justify;">I not think so because there is no significant difference in transferring of 1 byte and a null value.</p>
<p style="padding-left:30px;text-align:justify;">Other than that there is no difference between these two queries.</p>
<p style="padding-left:30px;text-align:justify;">Regards,</p>
<p style="padding-left:30px;text-align:justify;">Pinal Dave</p>
<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/#comment-61502" target="_blank">Comments by Marko Parkkola</a></strong></p>
<p style="padding-left:30px;text-align:justify;">“I not think so because there is no significant difference in transferring of 1 byte and a null value.”</p>
<p style="padding-left:30px;text-align:justify;">While that is true in this exact case I like to be pedantic about this and elaborate this a bit and probably confuse everybody up :)</p>
<p style="padding-left:30px;text-align:justify;">There is no concept NULL value if you think about C code or even the CPU. Pointers in C can have NULL values but that just means that the pointer is pointing to memory in the address 0×00000000 (in 32-bit machine). The actual pointer is still taking sizeof(VOID*) amount of memory even when it points to NULL.</p>
<p style="padding-left:30px;text-align:justify;">Now if you think about functions in C or any other language they always reserve space in the function stack for the return value. You can say, again in C, that you don’t care about the return value and declare the function to return “void” but still it takes 4 bytes of memory in 32-bit machine for return value.</p>
<p style="padding-left:30px;text-align:justify;">And actually, of you think about the CPU, there is 32 bit register reserved exactly for this.</p>
<p style="padding-left:30px;text-align:justify;">And now considering that it makes no difference to return one byte or four bytes since there is space for four bytes anyway. And in fact, many times (all the times?) when you deal with C data types CHAR (1 byte) or SHORT (2 bytes) you end up taking 4 bytes because of the padding to keep memory aligned.</p>
<p style="padding-left:30px;text-align:justify;"><span style="color:#333399;"><em><strong>Uh! I almost felt like going back in time some ten years when I was writing kernel drivers for Windows :)</strong></em></span></p>
<p style="text-align:justify;">This is excellent participation from experts like Marko and Brian. I really like the last line of Marko where it mentioned kernel drivers of Windows. Bravo everybody!</p>
<p style="text-align:justify;">If you have any suggestion please leave a comment in original article.</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>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/best-practices/'>Best Practices</a>, <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/readers-contribution/'>Readers Contribution</a>, <a href='http://blog.sqlauthority.com/category/readers-question/'>Readers Question</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-optimization/'>SQL Optimization</a>, <a href='http://blog.sqlauthority.com/category/sql-performance/'>SQL Performance</a>, <a href='http://blog.sqlauthority.com/category/sql-puzzle/'>SQL Puzzle</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sqlserver/'>SQLServer</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8029/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8029/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8029/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=8029&subd=sqlauthority&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/02/21/sql-server-if-existsselect-null-from-table-vs-if-existsselect-1-from-table/feed/</wfw:commentRss>
		<slash:comments>12</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; Stored Procedure Optimization Tips &#8211; Best Practices</title>
		<link>http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/</link>
		<comments>http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 01:30:11 +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 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 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=8000</guid>
		<description><![CDATA[We will go over how to optimize Stored Procedure with making simple changes in the code. Please note there are many more other tips, which we will cover in future articles.

 

Include SET NOCOUNT ON statement: With every SELECT and DML statement, the SQL server returns a message that indicates the number of affected rows [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=8000&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>We will go over how to optimize Stored Procedure with making simple changes in the code. Please note there are many more other tips, which we will cover in future articles.<strong><br />
</strong></p>
<p style="text-align:justify;"><strong> </strong></p>
<ul style="text-align:justify;">
<li><strong>Include SET NOCOUNT ON statement:</strong> With every SELECT and DML statement, the SQL server returns a message that indicates the number of affected rows by that statement. This information is mostly helpful in debugging the code, but it is useless after that. By setting SET NOCOUNT ON, we can disable the feature of returning this extra information. For stored procedures that contain several statements or contain Transact-SQL loops, setting SET NOCOUNT to ON can provide a significant performance boost because network traffic is greatly reduced.</li>
</ul>
<p style="padding-left:60px;text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE PROC </span><span style="color:black;">dbo.ProcName<br />
</span><span style="color:blue;">AS<br />
SET </span><span style="color:black;">NOCOUNT </span><span style="color:blue;">ON</span><span style="color:gray;">;<br />
</span><span style="color:green;">--Procedure code here<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">column1 </span><span style="color:blue;">FROM </span><span style="color:black;">dbo.TblTable1<br />
</span><span style="color:green;">-- Reset SET NOCOUNT to OFF<br />
</span><span style="color:blue;">SET </span><span style="color:black;">NOCOUNT </span><span style="color:blue;">OFF</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO </span></code></p>
<ul style="text-align:justify;">
<li><strong>Use schema name with object name:</strong> The object name is qualified if used with schema name. Schema name should be used with the stored procedure name and with all objects referenced inside the stored procedure. This help in directly finding the complied plan instead of searching the objects in other possible schema before finally deciding to use a cached plan, if available. This process of searching and deciding a schema for an object leads to COMPILE lock on stored procedure and decreases the stored procedure’s performance. Therefore, always refer the objects with qualified name in the stored procedure like</li>
</ul>
<p style="padding-left:60px;text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">dbo.MyTable </span><span style="color:green;">-- Preferred method<br />
-- Instead of<br />
</span><span style="color:blue;">SELECT </span><span style="color:gray;">* </span><span style="color:blue;">FROM </span><span style="color:black;">MyTable </span><span style="color:green;">-- Avoid this method<br />
--And finally call the stored procedure with qualified name like:<br />
</span><span style="color:blue;">EXEC </span><span style="color:black;">dbo.MyProc </span><span style="color:green;">-- Preferred method<br />
--Instead of<br />
</span><span style="color:blue;">EXEC </span><span style="color:black;">MyProc </span><span style="color:green;">-- Avoid this method</span></code></p>
<ul style="text-align:justify;">
<li><strong>Do not use the prefix &#8220;sp_&#8221; in the stored procedure name</strong>: If a stored procedure name begins with “SP_,” then SQL server first searches in the master database and then in the current session database. Searching in the master database causes extra overhead and even a wrong result if another stored procedure with the same name is found in master database.</li>
</ul>
<ul style="text-align:justify;">
<li><strong>Use IF EXISTS (SELECT 1) instead of (SELECT *):</strong> To check the existence of a record in another table, we uses the IF EXISTS clause. The IF EXISTS clause returns True if any value is returned from an internal statement, either a single value “1” or all columns of a record or complete recordset. The output of the internal statement is not used. Hence, to minimize the data for processing and network transferring, we should use “1” in the SELECT clause of an internal statement, as shown below:</li>
</ul>
<p style="padding-left:60px;text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">IF </span><span style="color:gray;">EXISTS (</span><span style="color:blue;">SELECT </span><span style="color:black;">1 </span><span style="color:blue;">FROM </span><span style="color:black;">sysobjects<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">name </span><span style="color:blue;">= </span><span style="color:red;">'MyTable' </span><span style="color:gray;">AND </span><span style="color:black;">type </span><span style="color:blue;">= </span><span style="color:red;">'U'</span><span style="color:gray;">)</span></code> <strong> </strong></p>
<ul>
<li><strong>Use the sp_executesql stored procedure instead of the EXECUTE statement.</strong><br />
The sp_executesql stored procedure supports parameters. So, using the sp_executesql stored procedure instead of the EXECUTE statement improve the re-usability of your code. The execution plan of a dynamic statement can be reused only if each and every character, including case, space, comments and parameter, is same for two statements. For example, if we execute the below batch:</li>
</ul>
<p style="padding-left:60px;text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">DECLARE </span><span style="color:#434343;">@Query </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">)<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@Age </span><span style="color:blue;">INT<br />
SET </span><span style="color:#434343;">@Age </span><span style="color:blue;">= </span><span style="color:black;">25<br />
</span><span style="color:blue;">SET </span><span style="color:#434343;">@Query </span><span style="color:blue;">= </span><span style="color:red;">'SELECT * FROM dbo.tblPerson WHERE Age = ' </span><span style="color:gray;">+ </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:black;">3</span><span style="color:gray;">),</span><span style="color:#434343;">@Age</span><span style="color:gray;">)<br />
</span><span style="color:blue;">EXEC </span><span style="color:gray;">(</span><span style="color:#434343;">@Query</span><span style="color:gray;">)</span></code></p>
<p style="text-align:justify;">If we again execute the above batch using different @Age value, then the execution plan for SELECT statement created for @Age =25 would not be reused. However, if we write the above batch as given below,</p>
<p style="padding-left:60px;text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">DECLARE </span><span style="color:#434343;">@Query </span><span style="color:blue;">NVARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SET </span><span style="color:#434343;">@Query </span><span style="color:blue;">= </span><span style="color:red;">N'SELECT * FROM dbo.tblPerson WHERE Age = @Age'<br />
</span><span style="color:blue;">EXECUTE </span><span style="color:darkred;">sp_executesql </span><span style="color:#434343;">@Query</span><span style="color:gray;">, </span><span style="color:red;">N'@Age int'</span><span style="color:gray;">, </span><span style="color:#434343;">@Age </span><span style="color:blue;">= </span><span style="color:black;">25</span></code></p>
<p style="text-align:justify;">the compiled plan of this SELECT statement will be reused for different value of @Age parameter. The reuse of the existing complied plan will result in improved performance.</p>
<ul style="text-align:justify;">
<li> <strong>Try to avoid using SQL Server cursors whenever possible:</strong> Cursor uses a lot of resources for overhead processing to maintain current record position in a recordset and this decreases the performance. If we need to process records one-by-one in a loop, then we should use the WHILE clause. Wherever possible, we should replace the cursor-based approach with SET-based approach. Because the SQL Server engine is designed and optimized to perform SET-based operation very fast. Again, please note cursor is also a kind of WHILE Loop.</li>
<li><strong>Keep the Transaction as short as possible:</strong> The length of transaction affects blocking and deadlocking. Exclusive lock is not released until the end of transaction. In higher isolation level, the shared locks are also aged with transaction. Therefore, lengthy transaction means locks for longer time and locks for longer time turns into blocking. In some cases, blocking also converts into deadlocks. So, for faster execution and less blocking, the transaction should be kept as short as possible.</li>
<li> <strong>Use TRY-Catch for error handling</strong>: Prior to SQL server 2005 version code for error handling, there was a big portion of actual code because an error check statement was written after every t-sql statement. More code always consumes more resources and time. In SQL Server 2005, a new simple way is introduced for the same purpose. The syntax is as follows:</li>
</ul>
<p style="padding-left:60px;text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">BEGIN </span><span style="color:black;">TRY<br />
</span><span style="color:green;">--Your t-sql code goes here<br />
</span><span style="color:blue;">END </span><span style="color:black;">TRY<br />
</span><span style="color:blue;">BEGIN </span><span style="color:black;">CATCH<br />
</span><span style="color:green;">--Your error handling code goes here<br />
</span><span style="color:blue;">END </span><span style="color:black;">CATCH</span></code></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>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/best-practices/'>Best Practices</a>, <a href='http://blog.sqlauthority.com/category/tech/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/sql/'>SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-authority/'>SQL Authority</a>, <a href='http://blog.sqlauthority.com/category/sql-coding-standards/'>SQL Coding Standards</a>, <a href='http://blog.sqlauthority.com/category/sql-optimization/'>SQL Optimization</a>, <a href='http://blog.sqlauthority.com/category/sql-performance/'>SQL Performance</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/tech/sql-scripts/'>SQL Scripts</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/sql-stored-procedure/'>SQL Stored Procedure</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-tips-and-tricks/'>SQL Tips and Tricks</a>, <a href='http://blog.sqlauthority.com/category/sqlserver/'>SQLServer</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/8000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/8000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/8000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/8000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/8000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/8000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/8000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/8000/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/8000/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/8000/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=8000&subd=sqlauthority&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/02/16/sql-server-stored-procedure-optimization-tips-best-practices/feed/</wfw:commentRss>
		<slash:comments>56</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; SQL Server Migration QuickStart</title>
		<link>http://blog.sqlauthority.com/2010/01/13/sqlauthority-news-sql-server-migration-quickstart/</link>
		<comments>http://blog.sqlauthority.com/2010/01/13/sqlauthority-news-sql-server-migration-quickstart/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 01:30:44 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Database]]></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[T SQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7740</guid>
		<description><![CDATA[The SQL Server Migration QuickStart includes a comprehensive set of technical content including presentations, whitepapers and demos that are designed to help you get details about how to approach your customers who want to improve the return on investment from their data platforms by migrating to SQL Server from their existing Oracle or Sybase platforms.
SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7740&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">The SQL Server Migration QuickStart includes a comprehensive set of technical content including presentations, whitepapers and demos that are designed to help you get details about how to approach your customers who want to improve the return on investment from their data platforms by migrating to SQL Server from their existing Oracle or Sybase platforms.</p>
<p style="text-align:justify;"><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=f76cb1ea-b1e8-4029-bfa4-c61b7768b7cb">SQL Server Migration QuickStart</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>
<br />Posted in Best Practices, Database, SQL, SQL Authority, SQL Documentation, SQL Download, 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/7740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7740/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7740/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7740/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7740&subd=sqlauthority&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2010/01/13/sqlauthority-news-sql-server-migration-quickstart/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>SQL SERVER &#8211; Difference Temp Table and Table Variable &#8211; Effect of Transaction</title>
		<link>http://blog.sqlauthority.com/2009/12/28/sql-server-difference-temp-table-and-table-variable-effect-of-transaction/</link>
		<comments>http://blog.sqlauthority.com/2009/12/28/sql-server-difference-temp-table-and-table-variable-effect-of-transaction/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 01:30:26 +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 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[SQLServer]]></category>
		<category><![CDATA[T SQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SQL Transactions]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7643</guid>
		<description><![CDATA[Few days ago I wrote an article on the myth of table variable stored in the memory—it was very well received by the community. Read complete article here: SQL SERVER – Difference TempTable and Table Variable – TempTable in Memory a Myth.
Today, I am going to write an article which follows the same series; in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7643&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Few days ago I wrote an article on the myth of table variable stored in the memory—it was very well received by the community. Read complete article here: <a href="http://blog.sqlauthority.com/2009/12/15/sql-server-difference-temptable-and-table-variable-temptable-in-memory-a-myth/" target="_blank">SQL SERVER – Difference TempTable and Table Variable – TempTable in Memory a Myth</a>.</p>
<p style="text-align:justify;">Today, I am going to write an article which follows the same series; in this, we will continue talking about the difference between TempTable and TableVariable. Both have the same structure and are stored in the database — in this article, we observe the effect of the transaction on the both the objects.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">DECLARE </span><span style="color:#434343;">@intVar </span><span style="color:blue;">INT<br />
SET </span><span style="color:#434343;">@intVar </span><span style="color:blue;">= </span><span style="color:black;">1<br />
</span><span style="color:blue;">SELECT </span><span style="color:#434343;">@intVar </span><span style="color:black;">BeforeTransaction<br />
</span><span style="color:blue;">BEGIN TRAN<br />
SET </span><span style="color:#434343;">@intVar </span><span style="color:blue;">= </span><span style="color:black;">2<br />
</span><span style="color:blue;">ROLLBACK<br />
SELECT </span><span style="color:#434343;">@intVar </span><span style="color:black;">AfterRollBackTran</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/tran.jpg" alt="" width="430" height="382" /></p>
<p style="text-align:justify;">It is a very well known fact that variables are unaffected by transaction as their scope is very limited, and for the same reason, variables should be very carefully used. Let us see very a quick example below that demonstrates that there transactions do not affect the local variable.</p>
<p style="text-align:justify;">Now let us carry out the same test on TempTable and Table Variables. If Table Variables are true variables, they should also demonstrate the same behavior. See the following example:</p>
<p style="text-align:justify;">
<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:green;">-- Create Temp Table and insert single row<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#TempTable </span><span style="color:gray;">(</span><span style="color:black;">Col1 </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">))<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#TempTable </span><span style="color:gray;">(</span><span style="color:black;">Col1</span><span style="color:gray;">)<br />
</span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:red;">'Temp Table - Outside Tran'</span><span style="color:gray;">);<br />
</span><span style="color:green;">-- Create Table Variable and insert single row<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@TableVar </span><span style="color:blue;">TABLE</span><span style="color:gray;">(</span><span style="color:black;">Col1 </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">))<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">@TableVar </span><span style="color:gray;">(</span><span style="color:black;">Col1</span><span style="color:gray;">)<br />
</span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:red;">'Table Var - Outside Tran'</span><span style="color:gray;">);<br />
</span><span style="color:green;">-- Check the Values in tables<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">Col1 </span><span style="color:blue;">AS </span><span style="color:black;">TempTable_BeforeTransaction<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">#TempTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">Col1 </span><span style="color:blue;">AS </span><span style="color:black;">TableVar_BeforeTransaction<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">@TableVar</span><span style="color:gray;">;<br />
</span><span style="color:green;">/*<br />
Insert additional row in trans<br />
Rollback Transaction at the end<br />
*/<br />
</span><span style="color:blue;">BEGIN TRAN<br />
</span><span style="color:green;">-- Insert single row<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#TempTable </span><span style="color:gray;">(</span><span style="color:black;">Col1</span><span style="color:gray;">)<br />
</span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:red;">'Temp Table - Inside Tran'</span><span style="color:gray;">);<br />
</span><span style="color:green;">-- Insert single row<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">@TableVar </span><span style="color:gray;">(</span><span style="color:black;">Col1</span><span style="color:gray;">)<br />
</span><span style="color:blue;">VALUES</span><span style="color:gray;">(</span><span style="color:red;">'Table Var - Inside Tran'</span><span style="color:gray;">);<br />
</span><span style="color:blue;">ROLLBACK<br />
</span><span style="color:green;">-- Check the Values in tables<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">Col1 </span><span style="color:blue;">AS </span><span style="color:black;">TempTable_AfterTransaction<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">#TempTable</span><span style="color:gray;">;<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">Col1 </span><span style="color:blue;">AS </span><span style="color:black;">TableVar_AfterTransaction<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">@TableVar</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Clean up<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:#434343;">#TempTable<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/tran1.jpg" alt="" width="500" height="700" /></p>
<p style="text-align:justify;">It is clear from example that just like any local variable table variable is not affected from transaction. This is very important detail to note as I have quite often seen developer using TempTable and TableVariables interchangeably without understanding their effect on transaction.</p>
<p style="text-align:justify;">Let me know if you have any other tip which you think will be helpful to readers.</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>
<p style="text-align:justify;">
<br />Posted in Best Practices, Database, Pinal Dave, SQL, SQL Authority, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology Tagged: SQL Transactions <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7643/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7643/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7643/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7643&subd=sqlauthority&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/12/28/sql-server-difference-temp-table-and-table-variable-effect-of-transaction/feed/</wfw:commentRss>
		<slash:comments>21</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/tran.jpg" medium="image" />

		<media:content url="http://www.pinaldave.com/bimg/tran1.jpg" medium="image" />
	</item>
		<item>
		<title>SQL SERVER &#8211; White Paper &#8211; Partitioned Table and Index Strategies Using SQL Server 2008</title>
		<link>http://blog.sqlauthority.com/2009/12/13/sql-server-white-paper-partitioned-table-and-index-strategies-using-sql-server-2008/</link>
		<comments>http://blog.sqlauthority.com/2009/12/13/sql-server-white-paper-partitioned-table-and-index-strategies-using-sql-server-2008/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 01:30:47 +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 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>
		<category><![CDATA[SQL Partitioned]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7532</guid>
		<description><![CDATA[When a database table grows in size to the hundreds of gigabytes or more, it can become more difficult to load new data, remove old data, and maintain indexes. Just the sheer size of the table causes such operations to take much longer. Even the data that must be loaded or removed can be very [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7532&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">When a database table grows in size to the hundreds of gigabytes or more, it can become more difficult to load new data, remove old data, and maintain indexes. Just the sheer size of the table causes such operations to take much longer. Even the data that must be loaded or removed can be very sizable, making INSERT and DELETE operations on the table impractical. The Microsoft SQL Server 2008 database software provides table partitioning to make such operations more manageable.</p>
<p style="text-align:justify;">Partitioning a large table divides the table and its indexes into smaller partitions, so that maintenance operations can be applied on a partition-by-partition basis, rather than on the entire table. In addition, the SQL Server optimizer can direct properly filtered queries to appropriate partitions rather than the entire table.</p>
<p style="text-align:justify;">This paper covers strategies and best practices for using partitioned tables and indexes in SQL Server 2008. It is intended for database architects, developers, and administrators of both data warehouse and OLTP systems, and the material is presented at an intermediate to advanced level.</p>
<p style="text-align:justify;"><a id="ctl00_MTCS_main_ctl02" href="http://download.microsoft.com/download/D/B/D/DBDE7972-1EB9-470A-BA18-58849DB3EB3B/PartTableAndIndexStrat.docx" target="_blank">Download &#8220;Partitioned Table and Index Strategies Using SQL Server 2008&#8243; white paper</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>
<br />Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Index, SQL Query, SQL Server, SQL Tips and Tricks, SQL White Papers, SQLAuthority News, T SQL, Technology Tagged: SQL Partitioned <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7532/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7532/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7532/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7532&subd=sqlauthority&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/12/13/sql-server-white-paper-partitioned-table-and-index-strategies-using-sql-server-2008/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>SQL SERVER &#8211; 2008 Star Join Query Optimization</title>
		<link>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/</link>
		<comments>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 01:30:01 +0000</pubDate>
		<dc:creator>pinaldave</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[Data Warehousing]]></category>
		<category><![CDATA[Pinal Dave]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Authority]]></category>
		<category><![CDATA[SQL Joins]]></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=7470</guid>
		<description><![CDATA[Business Intelligence (BI) plays a significant role in businesses nowadays. Moreover, the databases that deal with the queries related to BI are presently facing an increase in workload. At present, when queries are sent to very large databases, millions of rows are returned. Also the users have to go through extended query response times when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7470&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">Business Intelligence (BI) plays a significant role in businesses nowadays. Moreover, the databases that deal with the queries related to BI are presently facing an increase in workload. At present, when queries are sent to very large databases, millions of rows are returned. Also the users have to go through extended query response times when joining multiple tables are involved with such queries. ‘Star Join Query Optimization’ is a new feature of SQL Server 2008 Enterprise Edition. This mechanism uses bitmap filtering for improving the performance of some types of queries by the effective retrieval of rows from fact tables.</p>
<p style="text-align:justify;"><strong>Improved Query Response Times</strong><br />
In general, data warehouses employ dimensionally modeled star or snowflake schemas. These schemas have one or more than one fact tables that contain transactional data and many dimension tables, which holds information such as product data, customer information, and times and dates – all these define the fact table data. Usually, foreign keys are employed for maintaining relationships between the rows in fact tables and also between the rows in the dimension tables. Databases that contain star schemas are recognized by SQL Server 2008 Enterprise. It uses the new Star Join Query logic for processing queries against such star schemas more efficiently. Typically, on an average, data warehouse queries run faster to approximately 20 percent.</p>
<p style="text-align:justify;"><strong>Automatically Implemented</strong><br />
Star Join Query Optimization is automatically implemented by the SQL Server. It does not require a special database or application configuration. The query processor will usually optimize queries with medium selectivity (this refers to the queries that retrieve approximately 10% to 75% of rows from a fact table). Such queries are usually handled using hash joins to join the dimension and fact tables by employing the foreign keys to identify the matching rows. A hash table is built for each dimension table referenced in the query in the case of hash joins; the optimization process uses these hash tables for deriving bitmap filters. The key values from each dimension table are identified by bitmap filters; these key values qualify for inclusion in the query. When the fact table is scanned, the bitmap filters are applied to it. These bitmap filters eliminate those rows of the fact table which are not qualified for inclusion in the result set. The most selective bitmap filter is applied first as it is found to eliminate the highest number of rows. Since the eliminated rows do not need further processing, the subsequent filters need not be applied to them – this way the process becomes more efficient.</p>
<p style="text-align:justify;"><strong>Query Selectivity</strong><br />
The performance is enhanced in the case of medium selectivity queries while using bitmap filtering because the rows are filtered before any joins are implemented. Hence, there is a decrease in the number of rows that are processed by each join. Bitmap filtering is not applied when queries are highly selective (i.e., those queries that return less than 10% of the rows in a fact table). In such case, a nested loop join is found to be generally more efficient. Similarly, when the queries are not very selective at all (queries which return more than 75% of the rows in a fact table), bitmap filtering is not applied as there are very few rows to be filtered, and hence, there is no requirement of enhancement in performance in this case.</p>
<p style="text-align:justify;"><strong>Integer Data Types</strong><br />
Star join optimization is found to give the highest efficiency when the data type of the columns used in the joins is integer. This feature enables the bitmap filter to be applied as part of the initial table or index scan rather than being used at a later stage in the query plan. Most of the queries are benefited from star join optimization since foreign key relationships are commonly implemented using integer-based alternate key columns.</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;">
<br />Posted in Best Practices, Business Intelligence, Data Warehousing, Pinal Dave, SQL, SQL Authority, SQL Joins, 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/7470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7470/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7470/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7470/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7470&subd=sqlauthority&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/12/04/sql-server-2008-star-join-query-optimization/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>SQL SERVER &#8211; Comma Separated Values (CSV) from Table Column</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/</link>
		<comments>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 01:30:18 +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 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>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[SQL XML]]></category>

		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133</guid>
		<description><![CDATA[I use following script very often and I realized that I have never shared this script on this blog before. Creating Comma Separated Values (CSV) from Table Column is a very common task, and we all do this many times a day. Let us see the example that I use frequently and its output.
USE AdventureWorks
GO
-- Check Table Column
SELECT [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7133&subd=sqlauthority&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;">I use following script very often and I realized that I have never shared this script on this blog before. Creating Comma Separated Values (CSV) from Table Column is a very common task, and we all do this many times a day. Let us see the example that I use frequently and its output.</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:green;">-- Check Table Column<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">Name<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Shift<br />
GO<br />
</span><span style="color:green;">-- Get CSV values<br />
</span><span style="color:blue;">SELECT </span><span style="color:magenta;">SUBSTRING</span><span style="color:gray;">(<br />
(</span><span style="color:blue;">SELECT </span><span style="color:red;">',' </span><span style="color:gray;">+ </span><span style="color:black;">s.Name<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">HumanResources.Shift s<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">s.Name<br />
</span><span style="color:blue;">FOR </span><span style="color:black;">XML PATH</span><span style="color:gray;">(</span><span style="color:red;">''</span><span style="color:gray;">)),</span><span style="color:black;">2</span><span style="color:gray;">,</span><span style="color:black;">200000</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">CSV<br />
GO </span></code></p>
<p style="text-align:justify;">I consider XML as the best solution in terms of code and performance. Further, as I totally prefer this option, I am not even including the linka to my other articles, where I have described other options.</p>
<p style="text-align:justify;"><span style="color:black;"><img class="alignnone" src="http://www.pinaldave.com/bimg/csvxml.jpg" alt="" width="316" height="470" /><br />
</span></p>
<p style="text-align:justify;">Do you use any other method to resolve this issue? Can you find any significant difference in performance between these options? Please leave your comment 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;">
<br />Posted in Best Practices, Pinal Dave, SQL, SQL Authority, SQL Optimization, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: CSV, SQL XML <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/7133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/7133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/7133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/7133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/7133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/7133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/7133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/7133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/7133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/7133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&blog=668536&post=7133&subd=sqlauthority&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/feed/</wfw:commentRss>
		<slash:comments>28</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/csvxml.jpg" medium="image" />
	</item>
		<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[<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;">
<br />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" />]]></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[<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>
<br />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" />]]></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[<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>
<br />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" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/10/06/sql-server-interesting-observation-query-hint-force-order/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>

		<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[<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;">
<br />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" />]]></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[<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>
<br />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" />]]></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[<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>
<br />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" />]]></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[<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;">
<br />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" />]]></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>15</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[<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>
<br />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" />]]></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>39</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[<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>
<br />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" />]]></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>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; 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[<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>
<br />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" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/05/11/sql-server-questions-and-answers-with-database-administrators/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>
	</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[<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>
<br />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" />]]></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[<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>
<br />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" />]]></content:encoded>
			<wfw:commentRss>http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/feed/</wfw:commentRss>
		<slash:comments>91</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[<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>
<br />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" />]]></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[<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;">
<br />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" />]]></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[<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>
<br />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" />]]></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[<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>
<br />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" />]]></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>12</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[<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>
<br />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" />]]></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[<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>
<br />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" />]]></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>
	</channel>
</rss>