<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>SQL Server Journey with SQL Authority</title><link>http://blog.sqlauthority.com</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SQLAuthority" /><description>Personal Notes of Pinal Dave</description><language>en</language><image><link>http://blog.sqlauthority.com</link><url>http://0.gravatar.com/blavatar/08e35387c05b61340e885b1763a69d9f?s=96&amp;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url><title>SQL Server Journey with SQL Authority</title></image><lastBuildDate>Thu, 24 May 2012 22:11:05 PDT</lastBuildDate><generator>http://wordpress.com/</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="search" type="application/opensearchdescription+xml" href="http://blog.sqlauthority.com/osd.xml" title="SQL Server Journey with SQL Authority" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SQLAuthority" /><feedburner:info uri="sqlauthority" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://blog.sqlauthority.com/?pushpress=hub" /><feedburner:emailServiceId>SQLAuthority</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FSQLAuthority" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FSQLAuthority" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FSQLAuthority" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/SQLAuthority" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FSQLAuthority" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FSQLAuthority" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FSQLAuthority" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>Journey to SQL Authority with Pinal Dave http://www.SQLAuthority.com</feedburner:browserFriendly><item><title>SQL SERVER – A Puzzle – Fun with SEQUENCE in SQL Server 2012 – Guess the Next Value</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/gbkdwaWTysE/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Puzzle</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Thu, 24 May 2012 18:30:38 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18926</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">Yesterday my friend Vinod Kumar wrote excellent blog post on <a href="http://blogs.extremeexperts.com/2012/05/24/sql-server-2012-using-sequence/" target="_blank">SQL Server 2012: Using SEQUENCE</a>. I personally enjoyed reading the content on this subject. While I was reading the blog post, I thought of very simple new puzzle. Let us see if we can try to solve it and learn a bit more about Sequence.</p>
<p style="text-align:justify;">Here is the script, which I executed.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">TempDB<br />
GO<br />
</span><span style="color:green;">-- Create sequence<br />
</span><span style="color:blue;">CREATE </span><span style="color:black;">SEQUENCE dbo.SequenceID </span><span style="color:blue;">AS </span><span style="color:black;">BIGINT<br />
START </span><span style="color:blue;">WITH </span><span style="color:black;">3<br />
INCREMENT </span><span style="color:blue;">BY </span><span style="color:black;">1<br />
MINVALUE 1<br />
MAXVALUE 5<br />
CYCLE<br />
NO CACHE</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Following will return 3<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">next value </span><span style="color:blue;">FOR </span><span style="color:black;">dbo.SequenceID</span><span style="color:gray;">;<br />
</span><span style="color:green;">-- Following will return 4<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">next value </span><span style="color:blue;">FOR </span><span style="color:black;">dbo.SequenceID</span><span style="color:gray;">;<br />
</span><span style="color:green;">-- Following will return 5<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">next value </span><span style="color:blue;">FOR </span><span style="color:black;">dbo.SequenceID</span><span style="color:gray;">;<br />
</span><span style="color:green;">-- Following will return which number<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">next value </span><span style="color:blue;">FOR </span><span style="color:black;">dbo.SequenceID</span><span style="color:gray;">;<br />
</span><span style="color:green;">-- Clean up<br />
</span><span style="color:blue;">DROP </span><span style="color:black;">SEQUENCE dbo.SequenceID</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Above script gave me following resultset.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/seqpuz.jpg" alt="" width="481" height="371" /></p>
<p style="text-align:justify;">3 is the starting value and 5 is the maximum value. <em><strong>Once Sequence reaches to maximum value what happens? and WHY?</strong></em></p>
<p style="text-align:justify;"><em><strong></strong></em><br />
<strong>Bonus question:</strong> If you use UNION between 2 SELECT statement which uses UNION, it also throws an error. What is the reason behind it?</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/seqpuz2.jpg" alt="" width="421" height="188" /></p>
<p style="text-align:justify;">Can you attempt to answer this question without running this code in SQL Server 2012. I am very confident that irrespective of SQL Server version you are running you will have great learning. I will follow up of the answer in comments below.</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>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-puzzle/'>SQL Puzzle</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</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/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/18926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18926/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18926&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/PeAddIBPBHN7ngRMIz4rsHuoxRk/0/da"><img src="http://feedads.g.doubleclick.net/~a/PeAddIBPBHN7ngRMIz4rsHuoxRk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PeAddIBPBHN7ngRMIz4rsHuoxRk/1/da"><img src="http://feedads.g.doubleclick.net/~a/PeAddIBPBHN7ngRMIz4rsHuoxRk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gbkdwaWTysE:OvdN_1spaA0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gbkdwaWTysE:OvdN_1spaA0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gbkdwaWTysE:OvdN_1spaA0:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gbkdwaWTysE:OvdN_1spaA0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=gbkdwaWTysE:OvdN_1spaA0:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/gbkdwaWTysE" height="1" width="1"/>]]></content:encoded><description>Yesterday my friend Vinod Kumar wrote excellent blog post on SQL Server 2012: Using SEQUENCE. I personally enjoyed reading the content on this subject. While I was reading the blog post, I thought of very simple new puzzle. Let us see if we can try to solve it and learn a bit more about Sequence. Here is the [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18926&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/25/sql-server-a-puzzle-fun-with-sequence-in-sql-server-2012-guess-the-next-value/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/seqpuz.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/seqpuz2.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/25/sql-server-a-puzzle-fun-with-sequence-in-sql-server-2012-guess-the-next-value/</feedburner:origLink></item><item><title>SQL SERVER – A Puzzle – Fun with NULL – Fix Error 8117</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/0XOpMyFfWYc/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Puzzle</category><category>SQL Query</category><category>SQL Scripts</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Wed, 23 May 2012 18:30:54 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18912</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">During my 8 years of career, I have been involved in many interviews. Quite often, I act as the  interview. If I am the interviewer, I ask many questions &#8211; from easy questions to difficult ones. When I am the interviewee, I frequently get an opportunity to ask the interviewer some questions back. Regardless of the my capacity in attending the interview, I always make it a point to ask the interviewer at least one question.</p>
<h3 style="text-align:justify;"><strong>What is NULL?</strong></h3>
<p style="text-align:justify;">It’s always fun to ask this question during interviews, because in every interview, I get a different answer. NULL is often confused with false, absence of value or infinite value. Honestly, NULL is a very interesting subject as it bases its behavior in server settings. There are a few properties of NULL that are universal, but the knowledge about these properties is not known in a universal sense.</p>
<p style="text-align:justify;">Let us run this simple puzzle. Run the following T-SQL script:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">data</span><span style="color:gray;">)<br />
</span><span style="color:blue;">FROM </span><span style="color:gray;">(</span><span style="color:blue;">SELECT </span><span style="color:gray;">NULL </span><span style="color:blue;">AS </span><span style="color:black;">data</span><span style="color:gray;">) </span><span style="color:black;">t<br />
</span></code></p>
<p style="text-align:justify;">It will return the following error:</p>
<p style="text-align:justify;"><span style="color:#ff0000;">Msg 8117, Level 16, State 1, Line 1</span><br />
<span style="color:#ff0000;"> Operand data type NULL is invalid for sum operator.</span></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/8117error.jpg" alt="" width="427" height="154" /></p>
<p style="text-align:justify;">Now the error makes it very clear that NULL is invalid for sum Operator. Frequently enough, I have showed this simple query to many folks whom I came across. I asked them if they could modify the subquery and return the result as NULL. Here is what I expected:</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/8117error1.jpg" alt="" width="457" height="177" /></p>
<p style="text-align:justify;">Even though this is a very simple looking query, so far I’ve got the correct answer from only 10% of the people to whom I have asked this question. It was common for me to receive this kind of answer – convert the NULL to some data type. However, doing so usually returns the value as 0 or the integer they passed.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">data</span><span style="color:gray;">)<br />
</span><span style="color:blue;">FROM </span><span style="color:gray;">(</span><span style="color:blue;">SELECT </span><span style="color:magenta;">ISNULL</span><span style="color:gray;">(NULL,</span><span style="color:black;">0</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">data</span><span style="color:gray;">) </span><span style="color:black;">t</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/8117error2.jpg" alt="" width="436" height="173" /></p>
<p style="text-align:justify;">I usually see many people modifying the outer query to get desired NULL result, but that is not allowed in this simple puzzle. This small puzzle made me wonder how many people have a clear understanding about NULL.</p>
<p style="text-align:justify;">Well, here is the answer to my simple puzzle. Just CAST NULL AS INT and it will return the final result as NULL:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">data</span><span style="color:gray;">)<br />
</span><span style="color:blue;">FROM </span><span style="color:gray;">(</span><span style="color:blue;">SELECT </span><span style="color:magenta;">CAST</span><span style="color:gray;">(NULL </span><span style="color:blue;">AS INT</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">data</span><span style="color:gray;">) </span><span style="color:black;">t<br />
</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/8117error3.jpg" alt="" width="460" height="166" /></p>
<p style="text-align:justify;">Now that you know the answer, don&#8217;t you think it was very simple indeed? This blog post is especially dedicated to my friend <strong>Madhivanan</strong> who has written an excellent blog post about NULL. I am confident that after reading the blog post from Madhivanan, you will have no confusion regarding NULL in the future. Read: <a href="http://beyondrelational.com/modules/2/blogs/70/posts/14865/null-null-null-and-nothing-but-null.aspx" target="_blank"><strong>NULL, NULL, NULL and nothing but NULL</strong></a>.</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>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-puzzle/'>SQL Puzzle</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/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/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/18912/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18912/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18912/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18912/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18912/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18912/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18912/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18912/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18912/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18912/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18912/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18912/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18912/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18912/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18912&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/b4SYr2FnNRCTKYSaLZjgZHYVL3A/0/da"><img src="http://feedads.g.doubleclick.net/~a/b4SYr2FnNRCTKYSaLZjgZHYVL3A/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/b4SYr2FnNRCTKYSaLZjgZHYVL3A/1/da"><img src="http://feedads.g.doubleclick.net/~a/b4SYr2FnNRCTKYSaLZjgZHYVL3A/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=0XOpMyFfWYc:YJeN86ddALc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=0XOpMyFfWYc:YJeN86ddALc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=0XOpMyFfWYc:YJeN86ddALc:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=0XOpMyFfWYc:YJeN86ddALc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=0XOpMyFfWYc:YJeN86ddALc:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/0XOpMyFfWYc" height="1" width="1"/>]]></content:encoded><description>During my 8 years of career, I have been involved in many interviews. Quite often, I act as the  interview. If I am the interviewer, I ask many questions &amp;#8211; from easy questions to difficult ones. When I am the interviewee, I frequently get an opportunity to ask the interviewer some questions back. Regardless of the my [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18912&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/24/sql-server-a-puzzle-fun-with-null-fix-error-8117/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/8117error.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/8117error1.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/8117error2.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/8117error3.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/24/sql-server-a-puzzle-fun-with-null-fix-error-8117/</feedburner:origLink></item><item><title>SQL SERVER – Standard Reports from SQL Server Management Studio – SQL in Sixty Seconds #016 – Video</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/UVkAcACWnOo/</link><category>Database</category><category>Pinal Dave</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL in Sixty Seconds</category><category>SQL Query</category><category>SQL Scripts</category><category>SQL Server</category><category>SQL Server Management Studio</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><category>Video</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Tue, 22 May 2012 18:30:34 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18893</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;"><img class="alignleft" src="http://www.pinaldave.com/bimg/60.jpg" alt="" width="153" height="108" /></p>
<p style="text-align:justify;">SQL Server management Studio 2012 is wonderful tool and has many different features. Many times, an average user does not use them as they are not aware about these features. Today, we will learn one such feature. SSMS comes with many inbuilt performance and activity reports, but we do not use it to the full potential.</p>
<p style="text-align:justify;"><strong><em>Connect to SQL Server Node &gt;&gt; Right Click on it &gt;&gt; Go to Reports &gt;&gt; Click on Standard Reports &gt;&gt; Pick Any Report.</em></strong></p>
<p style="text-align:justify;"><span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/23/sql-server-standard-reports-from-sql-server-management-studio-sql-in-sixty-seconds-016-video/"><img src="http://img.youtube.com/vi/ORtv29rxXJI/2.jpg" alt="" /></a></span></p>
<p style="text-align:justify;">Please note that some of the reports can be IO intensive and not suggested to run during business hours!</p>
<p style="text-align:justify;"><strong>More on Standard Reports:<br />
</strong><strong></strong></p>
<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/2010/03/25/sql-server-default-activty-and-performance-reports-from-sssms/" target="_blank">SQL SERVER – Out of the Box – Activity and Performance Reports from SSSMS</a></strong><br />
<strong><a href="http://blog.sqlauthority.com/2010/03/26/sql-server-generate-report-for-index-physical-statistics-ssms/" target="_blank">SQL SERVER – Generate Report for Index Physical Statistics – SSMS<br />
</a><a href="http://blog.sqlauthority.com/2010/04/13/sql-server-configure-management-data-collection-in-quick-steps-t-sql-tuesday-005" target="_blank">SQL SERVER – Configure Management Data Collection in Quick Steps</a></strong></p>
<p style="text-align:justify;"><span style="text-align:justify;">I encourage you to submit your ideas for </span><strong><em>SQL in Sixty Seconds</em></strong><span style="text-align:justify;">. We will try to accommodate as many as we can.</span></p>
<p style="text-align:justify;">If we like your idea we promise to share with you educational material.</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>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/database/'>Database</a>, <a href='http://blog.sqlauthority.com/category/pinal-dave/'>Pinal Dave</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-in-sixty-seconds/'>SQL in Sixty Seconds</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/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-server-management-studio/'>SQL Server Management Studio</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/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>, <a href='http://blog.sqlauthority.com/category/video/'>Video</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/18893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18893/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18893/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18893/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18893/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18893/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18893/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18893/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18893&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/o870FhhgR786aZAftJOmPL336XQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/o870FhhgR786aZAftJOmPL336XQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/o870FhhgR786aZAftJOmPL336XQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/o870FhhgR786aZAftJOmPL336XQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=UVkAcACWnOo:zLl62jCg3aE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=UVkAcACWnOo:zLl62jCg3aE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=UVkAcACWnOo:zLl62jCg3aE:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=UVkAcACWnOo:zLl62jCg3aE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=UVkAcACWnOo:zLl62jCg3aE:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/UVkAcACWnOo" height="1" width="1"/>]]></content:encoded><description>SQL Server management Studio 2012 is wonderful tool and has many different features. Many times, an average user does not use them as they are not aware about these features. Today, we will learn one such feature. SSMS comes with many inbuilt performance and activity reports, but we do not use it to the full [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18893&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/23/sql-server-standard-reports-from-sql-server-management-studio-sql-in-sixty-seconds-016-video/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/60.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/23/sql-server-standard-reports-from-sql-server-management-studio-sql-in-sixty-seconds-016-video/</feedburner:origLink></item><item><title>SQL SERVER – SmallDateTime and Precision – A Continuous Confusion</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/QYBeMuNRKA0/</link><category>CodeProject</category><category>Developer Training</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL DateTime</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>SQLServer</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Mon, 21 May 2012 18:30:33 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18864</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">Some kinds of confusion never go away. Here is one of the ancient confusing things in SQL. The precision of the SmallDateTime is one concept that confuses a lot of people, proven by the many messages I receive everyday relating to this subject.</p>
<p style="text-align:justify;">Let me start with the question: <strong><em>What is the precision of the SMALLDATETIME datatypes?</em></strong></p>
<p style="text-align:justify;">What is your answer? Write it down on your notepad.</p>
<p style="text-align:justify;">Now if you do not want to continue reading the blog post, head to my previous blog post over here: <a href="http://blog.sqlauthority.com/2010/06/01/sql-server-precision-of-smalldatetime-a-1-minute-precision/" target="_blank"><strong>SQL SERVER – Precision of SMALLDATETIME</strong></a>.</p>
<h3 style="text-align:justify;">A Social Media Question</h3>
<p style="text-align:justify;">Since the increase of social media conversations, I noticed that the amount of the comments I receive on this blog is a bit staggering. I receive lots of questions on <strong><a href="http://facebook.com/SQLAuth" target="_blank">facebook</a></strong>, <a href="http://twitter.com/pinaldave" target="_blank"><strong>twitter</strong></a> or <a href="https://plus.google.com/104990425207662620918/" target="_blank"><strong>Google+</strong></a>. One of the very interesting questions yesterday was asked on Facebook by <strong><a href="http://www.facebook.com/SQLAuth/posts/313545408724259" target="_blank">Raghavendra</a></strong>. I am re-organizing his script and asking all of the questions he has asked me. Let us see if we could help him with his question:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:gray;">(</span><span style="color:black;">name </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">),</span><span style="color:black;">registered smalldatetime</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@test </span><span style="color:black;">smalldatetime<br />
</span><span style="color:blue;">SET </span><span style="color:#434343;">@test</span><span style="color:blue;">=</span><span style="color:magenta;">GETDATE</span><span style="color:gray;">()<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value1'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value2'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<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:#434343;">#temp<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">registered </span><span style="color:blue;">DESC<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Now when the above script is ran, we will get the following result:</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/smalldt1.jpg" alt="" width="277" height="82" /></p>
<p style="text-align:justify;">Well, the expectation of the query was to have the following result. The row which was inserted last was expected to return as first row in result set as the ORDER BY descending.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/smalldt2.jpg" alt="" width="284" height="83" /></p>
<p style="text-align:justify;"><strong>Side note:</strong> Because the requirement is to get the latest data, we can&#8217;t use any  column other than smalldatetime column in order by. If we use name column in the order by, we will get an incorrect result as it can be any name.</p>
<h3 style="text-align:justify;">My Initial Reaction</h3>
<p style="text-align:justify;">My initial reaction was as follows:</p>
<p style="text-align:justify;"><strong>1) DataType DateTime2:</strong> If file precision of the column is expected from the column which store date and time, it should not be smalldatetime. The precision of the column smalldatetime is One Minute (Read Here) for finer precision use DateTime or DateTime2 data type.</p>
<p style="text-align:justify;">Here is the code which includes above suggestion:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:gray;">(</span><span style="color:black;">name </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">), </span><span style="color:black;">registered datetime2</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@test </span><span style="color:black;">datetime2<br />
</span><span style="color:blue;">SET </span><span style="color:#434343;">@test</span><span style="color:blue;">=</span><span style="color:magenta;">GETDATE</span><span style="color:gray;">()<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value1'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value2'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<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:#434343;">#temp<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">registered </span><span style="color:blue;">DESC<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;"><strong>2) Tie Breaker Identity:</strong> There are always possibilities that two rows were inserted at the same time. In that case, you may need a tie breaker. If you have an increasing identity column, you can use that as a tie breaker as well.</p>
<p style="text-align:justify;"><strong><br />
</strong></p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:gray;">(</span><span style="color:black;">ID </span><span style="color:blue;">INT </span><span style="color:#434343;">IDENTITY</span><span style="color:gray;">(</span><span style="color:black;">1</span><span style="color:gray;">,</span><span style="color:black;">1</span><span style="color:gray;">), </span><span style="color:black;">name </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">),</span><span style="color:black;">registered datetime2</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@test </span><span style="color:black;">datetime2<br />
</span><span style="color:blue;">SET </span><span style="color:#434343;">@test</span><span style="color:blue;">=</span><span style="color:magenta;">GETDATE</span><span style="color:gray;">()<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value1'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value2'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<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:#434343;">#temp<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">ID </span><span style="color:blue;">DESC<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Those two were the quick suggestions I provided. It is not necessary that you should use both advices. It is possible that one can use only DATETIME datatype or Identity column can have datatype of BIGINT or have another tie breaker.</p>
<h3 style="text-align:justify;">An Alternate <span style="color:#ff0000;">NO</span> Solution</h3>
<p style="text-align:justify;">In the<strong> <a href="http://www.facebook.com/SQLAuth/posts/313545408724259" target="_blank">facebook thread</a></strong> this was also discussed as one of the solutions:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:gray;">(</span><span style="color:black;">name </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">),</span><span style="color:black;">registered smalldatetime</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@test </span><span style="color:black;">smalldatetime<br />
</span><span style="color:blue;">SET </span><span style="color:#434343;">@test</span><span style="color:blue;">=</span><span style="color:magenta;">GETDATE</span><span style="color:gray;">()<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value1'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value2'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">name</span><span style="color:gray;">, </span><span style="color:black;">registered</span><span style="color:gray;">,<br />
</span><span style="color:black;">ROW_NUMBER</span><span style="color:gray;">() </span><span style="color:blue;">OVER</span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:black;">registered </span><span style="color:blue;">DESC</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">"Row Number"<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">#temp </span><span style="color:blue;">ORDER BY </span><span style="color:black;">3 </span><span style="color:blue;">DESC<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">However, I believe it is not the solution and can be further misleading if used in a production server. Here is the example of why it is not a good solution:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:gray;">(</span><span style="color:black;">name </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">) NOT NULL,</span><span style="color:black;">registered smalldatetime</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@test </span><span style="color:black;">smalldatetime<br />
</span><span style="color:blue;">SET </span><span style="color:#434343;">@test</span><span style="color:blue;">=</span><span style="color:magenta;">GETDATE</span><span style="color:gray;">()<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value1'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">VALUES </span><span style="color:gray;">(</span><span style="color:red;">'Value2'</span><span style="color:gray;">,</span><span style="color:#434343;">@test</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Before Index<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">name</span><span style="color:gray;">, </span><span style="color:black;">registered</span><span style="color:gray;">,<br />
</span><span style="color:black;">ROW_NUMBER</span><span style="color:gray;">() </span><span style="color:blue;">OVER</span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:black;">registered </span><span style="color:blue;">DESC</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">"Row Number"<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">#temp </span><span style="color:blue;">ORDER BY </span><span style="color:black;">3 </span><span style="color:blue;">DESC<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Create Index<br />
</span><span style="color:blue;">ALTER TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:blue;">ADD CONSTRAINT </span><span style="color:black;">[PK_#temp] </span><span style="color:blue;">PRIMARY KEY CLUSTERED<br />
</span><span style="color:gray;">(</span><span style="color:black;">name </span><span style="color:blue;">DESC</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- After Index<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">name</span><span style="color:gray;">, </span><span style="color:black;">registered</span><span style="color:gray;">,<br />
</span><span style="color:black;">ROW_NUMBER</span><span style="color:gray;">() </span><span style="color:blue;">OVER</span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:black;">registered </span><span style="color:blue;">DESC</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">"Row Number"<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">#temp </span><span style="color:blue;">ORDER BY </span><span style="color:black;">3 </span><span style="color:blue;">DESC<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:#434343;">#temp<br />
</span><span style="color:black;">GO<br />
</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/smalldt3.jpg" alt="" width="373" height="247" /></p>
<p style="text-align:justify;">Now let us examine the resultset. You will notice that an index which is created on the base table which is (indeed) schema change the table but can affect the resultset. As you can see, an index can change the resultset, so this method is not yet perfect to get the latest inserted resultset.</p>
<h3 style="text-align:justify;">No Schema Change Requirement</h3>
<p style="text-align:justify;">After giving these two suggestions, I was waiting for the feedback of the asker. However, the requirement of the asker was there can&#8217;t be any schema change because the application was used by many other applications. I validated again, and of course, the requirement is no schema change at all. No addition of the column of change of datatypes of any other columns. There is no further help as well.</p>
<p style="text-align:justify;">This is indeed an interesting question. I personally can&#8217;t think of any solution which I could provide him given the requirement of no schema change. Can you think of any other solution to this?</p>
<h3 style="text-align:justify;">Need of Database Designer</h3>
<p style="text-align:justify;">This question once again brings up another ancient question:  “Do we need a database designer?” I often come across databases which are facing major performance problems or have redundant data. Normalization is often ignored when a database is built fast under a very tight deadline. Often I come across a database which has table with unnecessary columns and performance problems. While working as Developer Lead in my earlier jobs, I have seen developers adding columns to tables without anybody’s consent and retrieving them as SELECT *.  There is a lot to discuss on this subject in detail, but for now, let’s discuss the question first. Do you have any suggestions for the above question?</p>
<p style="text-align:justify;">Reference: <strong></strong><strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/codeproject-2/'>CodeProject</a>, <a href='http://blog.sqlauthority.com/category/developer-training/'>Developer Training</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-datetime/'>SQL DateTime</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</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/18864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18864/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18864/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18864/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18864&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/q17Mq01eFdGSDk8iWmIqx37epS8/0/da"><img src="http://feedads.g.doubleclick.net/~a/q17Mq01eFdGSDk8iWmIqx37epS8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/q17Mq01eFdGSDk8iWmIqx37epS8/1/da"><img src="http://feedads.g.doubleclick.net/~a/q17Mq01eFdGSDk8iWmIqx37epS8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=QYBeMuNRKA0:6lDGTw8Yids:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=QYBeMuNRKA0:6lDGTw8Yids:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=QYBeMuNRKA0:6lDGTw8Yids:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=QYBeMuNRKA0:6lDGTw8Yids:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=QYBeMuNRKA0:6lDGTw8Yids:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/QYBeMuNRKA0" height="1" width="1"/>]]></content:encoded><description>Some kinds of confusion never go away. Here is one of the ancient confusing things in SQL. The precision of the SmallDateTime is one concept that confuses a lot of people, proven by the many messages I receive everyday relating to this subject. Let me start with the question: What is the precision of the SMALLDATETIME datatypes? [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18864&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/22/sql-server-smalldatetime-and-precision-a-continuous-confusion/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/smalldt1.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/smalldt2.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/smalldt3.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/22/sql-server-smalldatetime-and-precision-a-continuous-confusion/</feedburner:origLink></item><item><title>SQL SERVER – Renaming Index – Index Naming Conventions</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/1nxmn_EHdXQ/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Index</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Sun, 20 May 2012 18:30:46 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18808</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;"><img class="alignleft" src="http://www.pinaldave.com/bimg/MyName.jpg" alt="" width="225" />If you are regular reader of this blog, you must be aware of that there are two kinds of blog posts 1) I share what I learn recently 2) I share what I learn and request your participation. Today&#8217;s blog post is where I need your opinion to make this blog post a good reference for future.</p>
<h3 style="text-align:justify;">Background Story</h3>
<p style="text-align:justify;">Recently I came across system where users have changed the name of the few of the table to match their new standard naming convention. The name of the table should be self explanatory and they should have explain their purpose without either opening it or reading documentations. Well, not every time this is possible but again this should be the goal of any database modeler. Well, I no way encourage the name of the tables to be too long like &#8216;ContainsDetailsofNewInvoices&#8217;. May be the name of the table should be &#8216;Invoices&#8217; and table should contain a column with New/Processed bit filed to indicate if the invoice is processed or not (if necessary). Coming back to original story, the database had several tables of which the name were changed.</p>
<h3 style="text-align:justify;">Story Continues&#8230;</h3>
<p style="text-align:justify;">To continue the story let me take simple example. There was a table with the name  &#8217;ReceivedInvoices&#8217;, it was changed to new name as &#8216;TblInvoices&#8217;. As per their new naming standard they had to prefix every talbe with the words &#8216;Tbl&#8217; and prefix every view with the letters &#8216;Vw&#8217;. Personally I do not see any need of the prefix but again, that issue is not here to discuss.  Now after changing the name of the table they faced very interesting situation. They had few indexes on the table which had name of the table. Let us take an example.</p>
<p style="text-align:justify;">Old Name of Table: <strong>ReceivedInvoice</strong><br />
Old Name of Index: <strong>Index_ReceivedInvoice1</strong></p>
<p style="text-align:justify;">Here is the new names</p>
<p style="text-align:justify;">New Name of Table: <strong>TblInvoices</strong><br />
New Name of Index: <strong>???</strong></p>
<p style="text-align:justify;">Well, their dilemma was what should be the new naming convention of the Indexes. Here is a quick proposal of the Index naming convention. Do let me know your opinion.</p>
<p style="text-align:left;"><em><strong>If Index is Primary Clustered Index: PK_TableName</strong></em><br />
<em><strong> If Index is  Non-clustered Index: IX_TableName_ColumnName1_ColumnName2&#8230;</strong></em><br />
<em><strong> If Index is Unique Non-clustered Index: UX_TableName_ColumnName1_ColumnName2&#8230;</strong></em><br />
<em><strong> If Index is Columnstore Non-clustered Index: CL_TableName</strong></em></p>
<p style="text-align:justify;">Here ColumnName is the column on which index is created. As there can be only one Primary Key Index and Columnstore Index per table, they do not require ColumnName in the name of the index. The purpose of this new naming convention is to increase readability. When any user come across this index, without opening their properties or definition, user can will know the details of the index.</p>
<h3 style="text-align:justify;">T-SQL script to Rename Indexes</h3>
<p style="text-align:justify;">Here is quick T-SQL script to rename Indexes</p>
<p><code style="font-size:12px;"><span style="color:blue;">EXEC </span><span style="color:darkred;">sp_rename </span><span style="color:red;">N'SchemaName.TableName.IndexName'</span><span style="color:gray;">, </span><span style="color:red;">N'New_IndexName'</span><span style="color:gray;">, </span><span style="color:red;">N'INDEX'</span><span style="color:gray;">;<br />
</span><span style="color:black;">GO</span></code></p>
<h3 style="text-align:justify;">Your Contribute Please</h3>
<p style="text-align:justify;">Well, the organization has already defined above four guidelines, personally I follow very similar guidelines too. I have seen many variations like adding prefixes CL for Clustered Index and NCL for Non-clustered Index. I have often seen many not using UX prefix for Unique Index but rather use generic IX prefix only.</p>
<p style="text-align:justify;">Now do you think if they have missed anything in the coding standard. Is NCI and CI prefixed required to additionally describe the index names. I have once received suggestion to even add fill factor in the index name &#8211; which I do not recommend at all.</p>
<p style="text-align:justify;"><strong>What do you think should be ideal name of the index, so it explains all the most important properties? </strong><em>Additionally, you are welcome to vote if you believe changing the name of index is just waste of time and energy. </em></p>
<p style="text-align:justify;">Note: The purpose of the blog post is to encourage all to participate with their ideas. I will write follow up blog posts in future compiling all the suggestions.</p>
<p style="text-align:justify;">Reference: <strong></strong><strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-index/'>SQL Index</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</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/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/18808/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18808/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18808/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18808/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18808/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18808/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18808/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18808/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18808/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18808/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18808/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18808/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18808/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18808/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18808&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/FZzNs7c6Xu7isU5lPNL5YGD-xRc/0/da"><img src="http://feedads.g.doubleclick.net/~a/FZzNs7c6Xu7isU5lPNL5YGD-xRc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FZzNs7c6Xu7isU5lPNL5YGD-xRc/1/da"><img src="http://feedads.g.doubleclick.net/~a/FZzNs7c6Xu7isU5lPNL5YGD-xRc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=1nxmn_EHdXQ:m9W0BUePzcA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=1nxmn_EHdXQ:m9W0BUePzcA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=1nxmn_EHdXQ:m9W0BUePzcA:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=1nxmn_EHdXQ:m9W0BUePzcA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=1nxmn_EHdXQ:m9W0BUePzcA:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/1nxmn_EHdXQ" height="1" width="1"/>]]></content:encoded><description>If you are regular reader of this blog, you must be aware of that there are two kinds of blog posts 1) I share what I learn recently 2) I share what I learn and request your participation. Today&amp;#8217;s blog post is where I need your opinion to make this blog post a good reference [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18808&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/21/sql-server-renaming-index-index-naming-conventions/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">11</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/MyName.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/21/sql-server-renaming-index-index-naming-conventions/</feedburner:origLink></item><item><title>SQL SERVER – New Look for CodePlexProject – Hosting for Open Source Software</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/dP2J1o88JoY/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Sat, 19 May 2012 18:30:35 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18792</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;"><img class="alignleft" src="http://www.pinaldave.com/bimg/codeplex1.jpg" alt="" width="250" height="125" />Codeplex is my favorite site. CodePlex is Microsoft&#8217;s free open source project hosting site. You can create projects to share with the world, collaborate with others on their projects, and download open source software. It is great place to find so many open source project available to explore. All the softwares are free and open source. I often go there at intervals to check what is new in SQL Server field as well on other technologies. Yesterday when I visited it, I had nice surprise as it has total makeover and looks very decent as well elegant at the same time.</p>
<p style="text-align:justify;">I have noticed that when I talk about Codeplex is user community, not everybody knows about it. The quickest way I explain what is codeplex is that I start naming few of the projects which are available there and suddenly I start noticing a few hands going up knowing the projects. This is indirect way to prove that many of us know CodePlex usability but do not pay special attention to what it is actually.</p>
<p style="text-align:justify;">Let me name a few popular projects of the CodePlex here.</p>
<ol style="text-align:justify;">
<li>SQL Server Sample Database [<a href="http://msftdbprodsamples.codeplex.com/" target="_blank">link</a>]</li>
<li>Image Resizer for Windows [<a href="http://imageresizer.codeplex.com/" target="_blank">link</a>]</li>
<li>Ajax Control Toolkit [<a href="http://ajaxcontroltoolkit.codeplex.com/" target="_blank">link</a>]</li>
<li>Skype Voice Changer [<a href="http://skypefx.codeplex.com/" target="_blank">link</a>]</li>
<li>Silverlight Toolkit [<a href="http://silverlight.codeplex.com/" target="_blank">link</a>]</li>
<li>Windows 7 USB/DBD Download Tool [<a href="http://wudt.codeplex.com/" target="_blank">link</a>]</li>
<li>Orchard Project [<a href="http://orchard.codeplex.com/" target="_blank">link</a>]</li>
</ol>
<p style="text-align:justify;">There are very interesting SQL Server projects available on Codeplex as well. I am listing few of them here for reference in listed in no particular order.</p>
<ol style="text-align:justify;">
<li>SQL Server Sample Database [<a href="http://msftdbprodsamples.codeplex.com/" target="_blank">link</a>]</li>
<li>SQL Server Compact ToolBox [<a href="http://sqlcetoolbox.codeplex.com/" target="_blank">link</a>]</li>
<li>Microsoft Drivers for PHP for SQL Server [<a href="http://sqlsrvphp.codeplex.com/" target="_blank">link</a>]</li>
<li>Internals Viewer for SQL Server [<a href="http://internalsviewer.codeplex.com/" target="_blank">link</a>]</li>
<li>SQL Server Spatial Tooks [<a href="http://sqlspatialtools.codeplex.com/" target="_blank">link</a>]</li>
<li>SQL Monitor &#8211; managing sql server performance [<a href="http://sqlmon.codeplex.com/" target="_blank">link</a>]</li>
<li><strong>SQL Server 2008 Extended Events SSMS Addin [<a href="http://extendedeventmanager.codeplex.com/" target="_blank">link</a>]</strong></li>
</ol>
<div style="text-align:justify;">How many of above mentioned project have you come across earlier? Leave a comment it will be interesting to know what our community is familiar with.</div>
<p style="text-align:justify;"><strong>Reference: </strong><strong></strong><strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/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/18792/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18792/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18792/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18792/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18792/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18792/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18792/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18792/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18792/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18792/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18792/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18792/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18792/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18792/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18792&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/qoc1kiPK3Jme1GMKWcqg_LSJmlc/0/da"><img src="http://feedads.g.doubleclick.net/~a/qoc1kiPK3Jme1GMKWcqg_LSJmlc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qoc1kiPK3Jme1GMKWcqg_LSJmlc/1/da"><img src="http://feedads.g.doubleclick.net/~a/qoc1kiPK3Jme1GMKWcqg_LSJmlc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=dP2J1o88JoY:sJosORgPPJE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=dP2J1o88JoY:sJosORgPPJE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=dP2J1o88JoY:sJosORgPPJE:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=dP2J1o88JoY:sJosORgPPJE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=dP2J1o88JoY:sJosORgPPJE:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/dP2J1o88JoY" height="1" width="1"/>]]></content:encoded><description>Codeplex is my favorite site. CodePlex is Microsoft&amp;#8217;s free open source project hosting site. You can create projects to share with the world, collaborate with others on their projects, and download open source software. It is great place to find so many open source project available to explore. All the softwares are free and open source. [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18792&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/20/sql-server-new-look-for-codeplexproject-hosting-for-open-source-software/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/codeplex1.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/20/sql-server-new-look-for-codeplexproject-hosting-for-open-source-software/</feedburner:origLink></item><item><title>SQL SERVER – Saturday Fun Puzzle with SQL Server DATETIME2 and CAST</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/zhch5Ybd_lc/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL DateTime</category><category>SQL Puzzle</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Fri, 18 May 2012 18:30:42 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18763</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">Note: I have used<em><strong> SQL Server 2012 </strong></em>for this small fun experiment.</p>
<p style="text-align:justify;">Here is what we are going to do. We will run the script one at time instead of running them all together and try to guess the answer. I am confident that many will get it correct but if you do not get correct, you learn something new.</p>
<p style="text-align:justify;">Let us create database and sample table.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">DB2012<br />
GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">DB2012<br />
GO<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">TableDT<br />
</span><span style="color:gray;">(</span><span style="color:black;">DT1 </span><span style="color:blue;">VARCHAR</span><span style="color:gray;">(</span><span style="color:black;">100</span><span style="color:gray;">), </span><span style="color:black;">DT2 DATETIME2</span><span style="color:gray;">,<br />
</span><span style="color:black;">DT1C </span><span style="color:blue;">AS </span><span style="color:black;">DT1</span><span style="color:gray;">, </span><span style="color:black;">DT2C </span><span style="color:blue;">AS </span><span style="color:black;">DT2</span><span style="color:gray;">);<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">TableDT </span><span style="color:gray;">(</span><span style="color:black;">DT1</span><span style="color:gray;">, </span><span style="color:black;">DT2</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:magenta;">GETDATE</span><span style="color:gray;">(), </span><span style="color:magenta;">GETDATE</span><span style="color:gray;">()<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">There are four columns in the table. The first column DT1 is regular VARCHAR and second DT2 is DATETIME2. Both of the column are been populated with the same data as I have used the function GETDATE(). Now let us do the SELECT statement and get the result from both the columns.</p>
<p style="text-align:justify;">Before running the query please guess the answer and write it down on the paper or notepad.</p>
<h3 style="text-align:justify;">Question 1: Guess the resultset</h3>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:black;">DT1</span><span style="color:gray;">, </span><span style="color:black;">DT2<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">TableDT<br />
GO</span></code></p>
<p style="text-align:justify;">Now once again run the select statement on the same table but this time retrieve the computed columns only. Once again I suggest you write down the result on the notepad.</p>
<h3 style="text-align:justify;">Question 2: Guess the resultset</h3>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:black;">DT1C</span><span style="color:gray;">, </span><span style="color:black;">DT2C<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">TableDT<br />
GO</span></code></p>
<p style="text-align:justify;">Now here is the best part. Let us use the CAST function over the computed columns. Here I do want you to stop and guess the answer for sure. If you have not done it so far, stop do it, believe me you will like it.</p>
<h3 style="text-align:justify;">Question 3: Guess the resultset</h3>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:black;">DT1C </span><span style="color:blue;">AS </span><span style="color:black;">DATETIME2</span><span style="color:gray;">) </span><span style="color:black;">CDT1C</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:black;">DT2C </span><span style="color:blue;">AS </span><span style="color:black;">DATETIME2</span><span style="color:gray;">) </span><span style="color:black;">CDT1C<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">TableDT<br />
GO<br />
</span></code></p>
<p style="text-align:justify;">Now let us inspect all the answers together and see how many of you got it correct.</p>
<p style="text-align:justify;"><strong>Answer 1:</strong></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/dt1.jpg" alt="" width="457" height="192" /></p>
<p style="text-align:justify;"><strong>Answer 2:</strong></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/dt2.jpg" alt="" width="448" height="196" /></p>
<p style="text-align:justify;"><strong>Answer 3: </strong></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/dt3.jpg" alt="" width="485" height="188" /></p>
<p style="text-align:justify;">If you have not tried to run the script so far, you can execute all the three of the above script together over here and see the result together.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:black;">DT1C </span><span style="color:blue;">AS </span><span style="color:black;">DATETIME2</span><span style="color:gray;">) </span><span style="color:black;">CDT1C</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">CAST</span><span style="color:gray;">(</span><span style="color:black;">DT2C </span><span style="color:blue;">AS </span><span style="color:black;">DATETIME2</span><span style="color:gray;">) </span><span style="color:black;">CDT1C<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">TableDT<br />
GO</span></code></p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/ad4.jpg" alt="" /></p>
<p style="text-align:justify;">Here is the Saturday Fun question to you &#8211; why do we get same result from both of the expressions in Question 3, where as in question 2 both the expression have different answer. I will publish the valid answer with explanation in future blog posts.</p>
<p style="text-align:justify;">Reference: <strong></strong><strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.sqlauthority.com</a>)</strong></p>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-datetime/'>SQL DateTime</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/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/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/18763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18763/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18763/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18763/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18763&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/80KxobH54rPaapzt4JsCUAC2gSA/0/da"><img src="http://feedads.g.doubleclick.net/~a/80KxobH54rPaapzt4JsCUAC2gSA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/80KxobH54rPaapzt4JsCUAC2gSA/1/da"><img src="http://feedads.g.doubleclick.net/~a/80KxobH54rPaapzt4JsCUAC2gSA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zhch5Ybd_lc:lJgvYdE-2QA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zhch5Ybd_lc:lJgvYdE-2QA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zhch5Ybd_lc:lJgvYdE-2QA:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zhch5Ybd_lc:lJgvYdE-2QA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=zhch5Ybd_lc:lJgvYdE-2QA:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/zhch5Ybd_lc" height="1" width="1"/>]]></content:encoded><description>Note: I have used SQL Server 2012 for this small fun experiment. Here is what we are going to do. We will run the script one at time instead of running them all together and try to guess the answer. I am confident that many will get it correct but if you do not get [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18763&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/19/sql-server-saturday-fun-puzzle-with-sql-server-datetime2-and-cast/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/dt1.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/dt2.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/dt3.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/ad4.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/19/sql-server-saturday-fun-puzzle-with-sql-server-datetime2-and-cast/</feedburner:origLink></item><item><title>SQL SERVER – Thinking about Deprecated, Discontinued Features and Breaking Changes while Upgrading to SQL Server 2012 – Guest Post by Nakul Vachhrajani</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/zGGiyqYMwJY/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><category>Upgrade</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Thu, 17 May 2012 18:30:12 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18745</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;"><img class="alignleft" src="http://www.pinaldave.com/bimg/nakul.jpg" alt="" width="175" height="158" />Nakul Vachhrajani is a Technical Specialist and systems development professional with iGATE having a total IT experience of more than 7 years. Nakul is an active blogger with BeyondRelational.com (150+ blogs), and can also be found on forums at SQLServerCentral and BeyondRelational.com. Nakul has also been a guest columnist for SQLAuthority.com and SQLServerCentral.com. Nakul presented a webcast on the &#8220;Underappreciated Features of Microsoft SQL Server&#8221; at the Microsoft Virtual Tech Days Exclusive Webcast series (May 02-06, 2011) on May 06, 2011. He is also the author of a research paper on Database upgrade methodologies, which was published in a CSI journal, published nationwide. In addition to his passion about SQL Server, Nakul also contributes to the academia out of personal interest. He visits various colleges and universities as an external faculty to judge project activities being carried out by the students. <strong>Disclaimer:</strong> <em>The opinions expressed herein are his own personal opinions and do not represent his employer&#8217;s view in anyway.</em></p>
<h3 style="text-align:justify;"><a href="http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx" target="_blank">Blog</a> | <a href="http://www.linkedin.com/pub/nakul-vachhrajani/33/306/368" target="_blank">LinkedIn</a> | <a href="https://twitter.com/#!/nakulv_sql" target="_blank">Twitter</a> | <a href="https://plus.google.com/112861901934490409954/posts" target="_blank">Google+</a></h3>
<p>Let us hear the thoughts of Nakul in first person -</p>
<hr />
<p style="text-align:justify;">Those who have been following <a href="http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx" target="_blank">my blogs</a> would be aware that I am recently running a series on the database engine features that have been deprecated in Microsoft SQL Server 2012. Based on the response that I have received, I was quite surprised to know that most of the audience found these to be breaking changes, when in fact, they were not! It was then that I decided to write a little piece on how to plan your database upgrade such that it works with the next version of Microsoft SQL Server.</p>
<p style="text-align:justify;">Please note that the recommendations made in this article are high-level markers and are intended to help you think over the specific steps that you would need to take to upgrade your database.</p>
<h2 style="text-align:justify;">Refer the documentation &#8211; Understand the terms</h2>
<p style="text-align:justify;">Change is the only constant in this world. Therefore, whenever customer requirements, newer architectures and designs require software vendors to make a change to the keywords, functions, etc; they ensure that they provide their end users sufficient time to migrate over to the new standards before dropping off the old ones. Microsoft does that too with it’s Microsoft SQL Server product. Whenever a new SQL Server release is announced, it comes with a list of the following features:</p>
<ol style="text-align:justify;">
<li><strong>Breaking changes</strong>
<ol>
<li>These are changes that would break your currently running applications, scripts or functionalities that are based on earlier version of Microsoft SQL Server</li>
<li>These are mostly features whose behavior has been changed keeping in mind the newer architectures and designs</li>
<li><strong>Lesson:</strong> These are the changes that you need to be most worried about!</li>
</ol>
</li>
<li><strong>Discontinued features</strong>
<ol>
<li>These features are no longer available in the associated version of Microsoft SQL Server</li>
<li>These features used to be “deprecated” in the prior release</li>
<li><strong>Lesson:</strong> Without these changes, your database would not be compliant/may not work with the version of Microsoft SQL Server under consideration</li>
</ol>
</li>
<li><strong>Deprecated features</strong>
<ol>
<li>These features are those that are still available in the current version of Microsoft SQL Server, but are scheduled for removal in a future version. These may be removed in either the next version or any other future version of Microsoft SQL Server</li>
<li>The features listed for deprecation will compose the list of discontinued features in the next version of SQL Server</li>
<li><strong>Lesson:</strong> Plan to make necessary changes required to remove/replace usage of the deprecated features with the latest recommended replacements</li>
</ol>
</li>
</ol>
<p style="text-align:justify;">Once a feature appears on the list, it moves from bottom to the top, i.e. it is first marked as “Deprecated” and then “Discontinued”. We know of “Breaking change” comes later on in the product life cycle.</p>
<p style="text-align:justify;">What this means is that if you want to know what features would not work with SQL Server 2012 (and you are currently using SQL Server 2008 R2), you need to refer the list of breaking changes and discontinued features in SQL Server 2012.</p>
<h2 style="text-align:justify;">Use the tools!</h2>
<p style="text-align:justify;">There are a lot of tools and technologies around us, but it is rarely that I find teams using these tools religiously and to the best of their potential. Below are the top two tools, from Microsoft, that I use every time I plan a database upgrade.</p>
<h3 style="text-align:justify;">The SQL Server Upgrade Advisor</h3>
<p style="text-align:justify;">Ever since SQL Server 2005 was announced, Microsoft provides a small, very light-weight tool called the “SQL Server upgrade advisor”. The upgrade advisor analyzes installed components from earlier versions of SQL Server, and then generates a report that identifies issues to fix either before or after you upgrade. The analysis examines objects that can be accessed, such as scripts, stored procedures, triggers, and trace files. Upgrade Advisor cannot analyze desktop applications or encrypted stored procedures.</p>
<p style="text-align:justify;">Refer the links towards the end of the post to know how to get the Upgrade Advisor.</p>
<h3 style="text-align:justify;">The SQL Server Profiler</h3>
<p style="text-align:justify;">Another great tool that you can use is the one most SQL Server developers &amp; administrators use often – the SQL Server profiler. SQL Server Profiler provides functionality to monitor the “Deprecation” event, which contains:</p>
<ul style="text-align:justify;">
<li>Deprecation announcement – equivalent to features to be deprecated in a <em>future</em> release of SQL Server</li>
<li>Deprecation final support – equivalent to features to be deprecated in the <em>next</em> release of SQL Server</li>
</ul>
<p style="text-align:justify;">You can learn more using the links towards the end of the post.</p>
<h2 style="text-align:justify;">A basic checklist</h2>
<p style="text-align:justify;">There are a lot of finer points that need to be taken care of when upgrading your database. But, it would be worth-while to identify a few basic steps in order to make your database compliant with the next version of SQL Server:</p>
<ol style="text-align:justify;">
<li>Monitor the current application workload (on a test bed) via the Profiler in order to identify usage of features marked as Deprecated
<ol>
<li>If none appear, you are all set! (This almost never happens)</li>
<li>Note down all the offending queries and feature usages</li>
</ol>
</li>
<li>Run analysis sessions using the SQL Server upgrade advisor on your database</li>
<li>Based on the inputs from the analysis report and Profiler trace sessions,
<ol>
<li>Incorporate solutions for the breaking changes first</li>
<li>Next, incorporate solutions for the discontinued features</li>
</ol>
</li>
<li>Revisit and document the upgrade strategy for your deployment scenarios</li>
<li>Revisit the fall-back, i.e. rollback strategies in case the upgrades fail
<ol>
<li>Because some programming changes are dependent upon the SQL server version, this may need to be done in consultation with the development teams</li>
</ol>
</li>
<li>Before any other enhancements are incorporated by the development team, send out the database changes into QA
<ol>
<li>QA strategy should involve a comparison between an environment running the old version of SQL Server against the new one</li>
<li>Because minimal application changes have gone in (essential changes for SQL Server version compliance only), this would be possible</li>
</ol>
</li>
<li>As an ongoing activity, keep incorporating changes recommended as per the deprecated features list</li>
<li>As a DBA, update your coding standards to ensure that the developers are using ANSI compliant code – this code will require a change only if the ANSI standard changes</li>
</ol>
<p style="text-align:justify;"><strong>Remember this:</strong> Change management is a continuous process. Keep revisiting the product release notes and incorporate recommended changes to stay prepared for the next release of SQL Server.</p>
<p style="text-align:justify;"><strong>May the power of SQL Server be with you!</strong></p>
<h2 style="text-align:justify;">Links Referenced in this post</h2>
<ul style="text-align:justify;">
<li>Breaking changes in SQL Server 2012: <a href="http://msdn.microsoft.com/en-us/library/ms143179" target="_blank">Link</a></li>
<li>Discontinued features in SQL Server 2012: <a href="http://msdn.microsoft.com/en-us/library/ms144262" target="_blank">Link</a></li>
<li>Get the upgrade advisor from the Microsoft Download Center at: <a href="http://go.microsoft.com/fwlink/?LinkID=208776" target="_blank">Link</a></li>
<li>Upgrade Advisor page on MSDN: <a href="http://msdn.microsoft.com/en-us/library/ms144256" target="_blank">Link</a></li>
<li>Profiler: Review T-SQL code to identify objects no longer supported by Microsoft: <a href="http://beyondrelational.com/modules/2/blogs/77/posts/11375/sql-server-profiler-part-4-review-t-sql-code-to-identify-objects-no-longer-supported-by-microsoft-de.aspx" target="_blank">Link</a></li>
<li>Upgrading to SQL Server 2012 by Vinod Kumar: <a href="http://blogs.extremeexperts.com/2012/05/17/upgrading-to-sql-server-2012/" target="_blank">Link</a></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></p>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a> Tagged: <a href='http://blog.sqlauthority.com/tag/upgrade/'>Upgrade</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/18745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18745/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18745/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18745/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18745&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/fJvl2V19IdSj4D7Lc2iRgQXHqAo/0/da"><img src="http://feedads.g.doubleclick.net/~a/fJvl2V19IdSj4D7Lc2iRgQXHqAo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/fJvl2V19IdSj4D7Lc2iRgQXHqAo/1/da"><img src="http://feedads.g.doubleclick.net/~a/fJvl2V19IdSj4D7Lc2iRgQXHqAo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zGGiyqYMwJY:NmTXHinSFVw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zGGiyqYMwJY:NmTXHinSFVw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zGGiyqYMwJY:NmTXHinSFVw:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=zGGiyqYMwJY:NmTXHinSFVw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=zGGiyqYMwJY:NmTXHinSFVw:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/zGGiyqYMwJY" height="1" width="1"/>]]></content:encoded><description>Nakul Vachhrajani is a Technical Specialist and systems development professional with iGATE having a total IT experience of more than 7 years. Nakul is an active blogger with BeyondRelational.com (150+ blogs), and can also be found on forums at SQLServerCentral and BeyondRelational.com. Nakul has also been a guest columnist for SQLAuthority.com and SQLServerCentral.com. Nakul presented a [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18745&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/18/sql-server-thinking-about-deprecated-discontinued-features-and-breaking-changes-while-upgrading-to-sql-server-2012-guest-post-by-nakul-vachhrajani/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">8</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/nakul.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/18/sql-server-thinking-about-deprecated-discontinued-features-and-breaking-changes-while-upgrading-to-sql-server-2012-guest-post-by-nakul-vachhrajani/</feedburner:origLink></item><item><title>SQLAuthority News – SQL Server 2012 Upgrade Technical Guide – A Comprehensive Whitepaper – (454 pages – 9 MB)</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/b8Ak2GhR4xE/</link><category>Database</category><category>DBA</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Documentation</category><category>SQL Download</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>SQL White Papers</category><category>SQLAuthority News</category><category>SQLServer</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Wed, 16 May 2012 18:30:35 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18717</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">Microsoft has just released SQL Server 2012 Upgrade Technical Guide. This guide is very comprehensive and covers the subject of upgrade in-depth. This is indeed a helpful detailed white paper. Even writing a summary of this white paper would take over 100 pages. This further proves that SQL Server 2012 is quite an important release from Microsoft. This white paper discusses how to upgrade from SQL Server 2008/R2 to SQL Server 2012. I love how it starts with the most interesting and basic discussion of upgrade strategies: 1) In-place upgrades, 2) Side by side upgrade, 3) One-server, and 4) Two-server. This whitepaper is not just pure theory but is also an excellent source for some tips and tricks. Here is an example of a good tip from the paper:</p>
<p style="text-align:justify;">&#8220;If you want to upgrade just one database from a legacy instance of SQL Server and not upgrade the other databases on the server, use the side-by-side upgrade method instead of the in-place method.&#8221;</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/SQLServer2012big.png" alt="" width="500" height="103" /></p>
<p style="text-align:justify;"><img class="alignleft" src="http://www.pinaldave.com/bimg/upgradenow.jpg" alt="" width="168" height="168" /></p>
<p style="text-align:justify;">There are so many trivia, tips and tricks that make creating the list seems humanly impossible given a short period of time. My friend Vinod Kumar, an SQL Server expert, wrote a very interesting article on SQL Server 2012 Upgrade before. In that article, Vinod addressed the most interesting and practical questions related to upgrades. He started with the fundamentals of how to start backup before upgrade and ended with fail-safe strategies after the upgrade is over. He covered end-to-end concepts in his blog posts in simple words in extremely precise statements.</p>
<p style="text-align:justify;">A successful upgrade uses a cycle of: planning, document process, testing, refine process, testing, planning upgrade window, execution, verifying of upgrade and opening for business. If you are at Vinod&#8217;s blog post, I suggest you go all the way down and collect the gold mine of most important links. I have bookmarked the blog by blogging about it and I suggest that you bookmark it as well with the way you prefer.</p>
<p style="text-align:justify;"><a href="http://blogs.extremeexperts.com/2012/05/17/upgrading-to-sql-server-2012/" target="_blank"><strong>Vinod Kumar&#8217;s blog post on SQL Server 2012 Upgrade Technical Guide</strong></a></p>
<p style="text-align:justify;">SQL Server 2012 Upgrade Technical Guide is a detailed resource that’s also available online for free. Each chapter was carefully crafted and explained in detail. Here is a quick list of the chapters included in the whitepaper. Before downloading the guide, beware of its size of 9 MB and 454 pages.</p>
<p style="text-align:justify;">Here’s the list of chapters:</p>
<p style="text-align:justify;">Chapter 1: Upgrade Planning and Deployment<br />
Chapter 2: Management Tools<br />
Chapter 3: Relational Databases<br />
Chapter 4: High Availability<br />
Chapter 5: Database Security<br />
Chapter 6: Full-Text Search<br />
Chapter 7: Service Broker<br />
Chapter 8: SQL Server Express<br />
Chapter 9: SQL Server Data Tools<br />
Chapter 10: Transact-SQL Queries<br />
Chapter 11: Spatial Data<br />
Chapter 12: XML and XQuery<br />
Chapter 13: CLR<br />
Chapter 14: SQL Server Management Objects<br />
Chapter 15: Business Intelligence Tools<br />
Chapter 16: Analysis Services<br />
Chapter 17: Integration Services<br />
Chapter 18: Reporting Services<br />
Chapter 19: Data Mining<br />
Chapter 20: Other Microsoft Applications and Platforms<br />
Appendix 1: Version and Edition Upgrade Paths<br />
Appendix 2: SQL Server 2012: Upgrade Planning Checklist</p>
<p style="text-align:justify;"><strong><a href="http://t.co/VcQaCMG3" target="_blank">Download SQL Server 2012 Upgrade Technical Guide</a></strong> [454 pages and 9 MB]</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>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/database/'>Database</a>, <a href='http://blog.sqlauthority.com/category/dba/'>DBA</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-documentation/'>SQL Documentation</a>, <a href='http://blog.sqlauthority.com/category/sql-download/'>SQL Download</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</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/sql-white-papers/'>SQL White Papers</a>, <a href='http://blog.sqlauthority.com/category/sqlauthority/sqlauthority-news/'>SQLAuthority News</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/18717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18717/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18717/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18717/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18717&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/jBwOF65so48Rq4HgVeWxB6UWCFo/0/da"><img src="http://feedads.g.doubleclick.net/~a/jBwOF65so48Rq4HgVeWxB6UWCFo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jBwOF65so48Rq4HgVeWxB6UWCFo/1/da"><img src="http://feedads.g.doubleclick.net/~a/jBwOF65so48Rq4HgVeWxB6UWCFo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=b8Ak2GhR4xE:hjZ8EJw9Ugc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=b8Ak2GhR4xE:hjZ8EJw9Ugc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=b8Ak2GhR4xE:hjZ8EJw9Ugc:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=b8Ak2GhR4xE:hjZ8EJw9Ugc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=b8Ak2GhR4xE:hjZ8EJw9Ugc:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/b8Ak2GhR4xE" height="1" width="1"/>]]></content:encoded><description>Microsoft has just released SQL Server 2012 Upgrade Technical Guide. This guide is very comprehensive and covers the subject of upgrade in-depth. This is indeed a helpful detailed white paper. Even writing a summary of this white paper would take over 100 pages. This further proves that SQL Server 2012 is quite an important release from [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18717&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/17/sqlauthority-news-sql-server-2012-upgrade-technical-guide-a-comprehensive-whitepaper-454-pages-9-mb/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/SQLServer2012big.png" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/upgradenow.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/17/sqlauthority-news-sql-server-2012-upgrade-technical-guide-a-comprehensive-whitepaper-454-pages-9-mb/</feedburner:origLink></item><item><title>SQL SERVER – SQL in Sixty Seconds – 5 Videos from Joes 2 Pros Series – SQL Exam Prep Series 70-433</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/XCITlyyWrDo/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><category>Video</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Tue, 15 May 2012 18:30:15 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18693</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;"><strong><a href="http://blog.sqlauthority.com/sql-server-books/sql-joes-2-pros-five-book-combo-list-of-best-sql-server-books/" target="_blank">Joes 2 Pros SQL Server</a></strong> Learning series is indeed fun. Joes 2 Pros series is written for beginners and who wants to build expertise for SQL Server programming and development from fundamental. In the beginning of the series author Rick Morelan is not shy to explain the simplest concept of how to open SQL Server Management Studio. Honestly the book starts with that much basic but as it progresses further Rick discussing about various advanced concepts from query tuning to Core Architecture.</p>
<p style="text-align:justify;">This five part series is written with keeping SQL Server Exam 70-433. Instead of just focusing on what will be there in exam, this series is focusing on learning the important concepts thoroughly. This book no way take short cut to explain any concepts and at times, will go beyond the topic at length. The best part is that all the books has many companion videos explaining the concepts and videos. Every Wednesday I like to post a video which explains something in quick few seconds. Today we will go over five videos which I posted in my earlier posts related to Joes 2 Pros series.</p>
<h3 id="watch-headline-title" style="text-align:justify;">Introduction to XML Data Type Methods &#8211; SQL in Sixty Seconds #015</h3>
<p style="text-align:justify;">The XML data type was first introduced with SQL Server 2005. This data type continues with SQL Server 2008 where expanded XML features are available, most notably is the power of the XQuery language to analyze and query the values contained in your XML instance.</p>
<p style="text-align:justify;">There are five XML data type methods available in SQL Server 2008:</p>
<p style="text-align:justify;"><strong>query()</strong> – Used to extract XML fragments from an XML data type.<br />
<strong>value()</strong> – Used to extract a single value from an XML document.<br />
<strong>exist()</strong> – Used to determine if a specified node exists. Returns 1 if yes and 0 if no.<br />
<strong>modify()</strong> – Updates XML data in an XML data type.<br />
<strong>node()</strong> – Shreds XML data into multiple rows (<em>not covered in this blog post</em>).</p>
<div style="text-align:justify;"><strong>[<a href="http://blog.sqlauthority.com/2012/04/27/sql-server-introduction-to-discovering-xml-data-type-methods-a-primer/" target="_blank">Detailed Blog Post</a>] | [<a href="http://blog.sqlauthority.com/2012/05/11/sql-server-quiz-and-video-introduction-to-discovering-xml-data-type-methods/" target="_blank">Quiz with Answer</a>]</strong></div>
<p style="text-align:justify;"><span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/16/sql-server-sql-in-sixty-seconds-5-videos-from-joes-2-pros-series-sql-exam-prep-series-70-433/"><img src="http://img.youtube.com/vi/0g61qFIOL0o/2.jpg" alt="" /></a></span></p>
<h3 id="watch-headline-title" style="text-align:justify;">Introduction to SQL Error Actions &#8211; SQL in Sixty Seconds #014</h3>
<p style="text-align:justify;">Most people believe that when SQL Server encounters an error severity level 11 or higher the remaining SQL statements will not get executed. In addition, people also believe that if any error severity level of 11 or higher is hit inside an explicit transaction, then the whole statement will fail as a unit. While both of these beliefs are true 99% of the time, they are not true in all cases. It is these outlying cases that frequently cause unexpected results in your SQL code.</p>
<p style="text-align:justify;">To understand how to achieve consistent results you need to know the four ways SQL Error Actions can react to error severity levels 11-16:</p>
<p style="text-align:justify;"><strong>Statement Termination</strong> – The statement with the procedure fails but the code keeps on running to the next statement. Transactions are not affected.<br />
<strong>Scope Abortion</strong> – The current procedure, function or batch is aborted and the next calling scope keeps running. That is, if Stored Procedure A calls B and C, and B fails, then nothing in B runs but A continues to call C. @@Error is set but the procedure does not have a return value.<br />
<strong>Batch Termination</strong> – The entire client call is terminated.<br />
<strong>XACT_ABORT</strong> – (<strong>ON</strong> = The entire client call is terminated.) or (<strong>OFF</strong> = SQL Server will choose how to handle all errors.)</p>
<p style="text-align:justify;"><strong>[<a href="http://blog.sqlauthority.com/2012/04/26/sql-server-introduction-to-sql-error-actions-a-primer/" target="_blank">Detailed Blog Post</a>] | [<a href="http://blog.sqlauthority.com/2012/05/10/sql-server-quiz-and-video-introduction-to-sql-error-actions/" target="_blank">Quiz with Answer</a>]</strong></p>
<p style="text-align:justify;"><span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/16/sql-server-sql-in-sixty-seconds-5-videos-from-joes-2-pros-series-sql-exam-prep-series-70-433/"><img src="http://img.youtube.com/vi/fPjOhr3b5Pk/2.jpg" alt="" /></a></span></p>
<h3 id="watch-headline-title" style="text-align:justify;">Introduction to Basics of a Query Hint &#8211; SQL in Sixty Seconds #013</h3>
<p style="text-align:justify;">Query hints specify that the indicated hints should be used throughout the query. Query hints affect all operators in the statement and are implemented using the OPTION clause. Cautionary Note: Because the SQL Server Query Optimizer typically selects the best execution plan for a query, it is highly recommended that hints be used as a last resort for experienced developers and database administrators to achieve the desired results.</p>
<p style="text-align:justify;"><strong>[<a href="http://blog.sqlauthority.com/2012/04/25/sql-server-introduction-to-basics-of-a-query-hint-a-primer/" target="_blank">Detailed Blog Post</a>] | [<a href="http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/" target="_blank">Quiz with Answer</a>]</strong></p>
<p style="text-align:justify;"><span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/16/sql-server-sql-in-sixty-seconds-5-videos-from-joes-2-pros-series-sql-exam-prep-series-70-433/"><img src="http://img.youtube.com/vi/0GTeUHkdZtc/2.jpg" alt="" /></a></span></p>
<h3 id="watch-headline-title" style="text-align:justify;">Introduction to Hierarchical Query &#8211; SQL in Sixty Seconds #012</h3>
<p style="text-align:justify;">A CTE can be thought of as a temporary result set and are similar to a derived table in that it is not stored as an object and lasts only for the duration of the query. A CTE is generally considered to be more readable than a derived table and does not require the extra effort of declaring a Temp Table while providing the same benefits to the user. However; a CTE is more powerful than a derived table as it can also be self-referencing, or even referenced multiple times in the same query. A recursive CTE requires four elements in order to work properly:</p>
<p style="text-align:justify;">Anchor query (runs once and the results ‘seed’ the Recursive query)<br />
Recursive query (runs multiple times and is the criteria for the remaining results)<br />
UNION ALL statement to bind the Anchor and Recursive queries together.<br />
INNER JOIN statement to bind the Recursive query to the results of the CTE.</p>
<p style="text-align:justify;"><strong>[<a href="http://blog.sqlauthority.com/2012/04/24/sql-server-introduction-to-hierarchical-query-using-a-recursive-cte-a-primer/" target="_blank">Detailed Blog Post</a>] | [<a href="http://blog.sqlauthority.com/2012/05/08/sql-server-quiz-and-video-introduction-to-hierarchical-query-using-a-recursive-cte/" target="_blank">Quiz with Answer</a>]</strong></p>
<p style="text-align:justify;"><span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/16/sql-server-sql-in-sixty-seconds-5-videos-from-joes-2-pros-series-sql-exam-prep-series-70-433/"><img src="http://img.youtube.com/vi/fbOGQlkFVqI/2.jpg" alt="" /></a></span></p>
<h3 id="watch-headline-title" style="text-align:justify;">Introduction to SQL Server Security &#8211; SQL in Sixty Seconds #011</h3>
<p style="text-align:justify;">Let’s get some basic definitions down first. Take the workplace example where “Tom” needs “Read” access to the “Financial Folder”. What are the Securable, Principal, and Permissions from that last sentence?</p>
<p style="text-align:justify;">A <strong>Securable</strong> is a resource that someone might want to access (like the Financial Folder).<br />
A <strong>Principal</strong> is anything that might want to gain access to the securable (like Tom).<br />
A <strong>Permission</strong> is the level of access a principal has to a securable (like Read).</p>
<p style="text-align:justify;">[<a href="http://blog.sqlauthority.com/2012/04/23/sql-server-introduction-to-sql-server-security-a-primer/" target="_blank">Detailed Blog Post</a>] | [<a href="http://blog.sqlauthority.com/2012/05/07/sql-server-quiz-and-video-introduction-to-sql-server-security/" target="_blank">Quiz with Answer</a>]</p>
<p style="text-align:justify;"><span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/16/sql-server-sql-in-sixty-seconds-5-videos-from-joes-2-pros-series-sql-exam-prep-series-70-433/"><img src="http://img.youtube.com/vi/NnaTqgyJGyU/2.jpg" alt="" /></a></span></p>
<p style="text-align:justify;">Please leave a comment explain which one was your favorite video as that will help me understand what works and what needs improvement.</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>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div style="text-align:justify;"></div>
<div></div>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a>, <a href='http://blog.sqlauthority.com/category/video/'>Video</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/18693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18693/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18693/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18693&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/Im7FT-FILU_NfqwiNccvesTq6GE/0/da"><img src="http://feedads.g.doubleclick.net/~a/Im7FT-FILU_NfqwiNccvesTq6GE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Im7FT-FILU_NfqwiNccvesTq6GE/1/da"><img src="http://feedads.g.doubleclick.net/~a/Im7FT-FILU_NfqwiNccvesTq6GE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=XCITlyyWrDo:vlYV91zQjiw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=XCITlyyWrDo:vlYV91zQjiw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=XCITlyyWrDo:vlYV91zQjiw:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=XCITlyyWrDo:vlYV91zQjiw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=XCITlyyWrDo:vlYV91zQjiw:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/XCITlyyWrDo" height="1" width="1"/>]]></content:encoded><description>Joes 2 Pros SQL Server Learning series is indeed fun. Joes 2 Pros series is written for beginners and who wants to build expertise for SQL Server programming and development from fundamental. In the beginning of the series author Rick Morelan is not shy to explain the simplest concept of how to open SQL Server [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18693&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/16/sql-server-sql-in-sixty-seconds-5-videos-from-joes-2-pros-series-sql-exam-prep-series-70-433/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><feedburner:origLink>http://blog.sqlauthority.com/2012/05/16/sql-server-sql-in-sixty-seconds-5-videos-from-joes-2-pros-series-sql-exam-prep-series-70-433/</feedburner:origLink></item><item><title>SQL SERVER – Get Schema Name from Object ID using OBJECT_SCHEMA_NAME</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/RxmI8GKkgOE/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL System Table</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Mon, 14 May 2012 18:30:21 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18678</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">Sometime a simple solution have even simpler solutions but we often do not practice it as we do not see value in it or find it useful. Well, today&#8217;s blog post is also about something which I have seen not practiced much in codes. We are so much comfortable with alternative usage that we do not feel like switching how we query the data.</p>
<p style="text-align:justify;">I was going over forums and I noticed that at one place user has used following code to get Schema Name from ObjectID.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks2012<br />
GO<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">s.name </span><span style="color:blue;">AS </span><span style="color:black;">SchemaName</span><span style="color:gray;">, </span><span style="color:black;">t.name </span><span style="color:blue;">AS </span><span style="color:black;">TableName</span><span style="color:gray;">,<br />
</span><span style="color:black;">s.schema_id</span><span style="color:gray;">, </span><span style="color:black;">t.</span><span style="color:magenta;">OBJECT_ID<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.Tables t<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">sys.schemas s </span><span style="color:blue;">ON </span><span style="color:black;">s.schema_id </span><span style="color:blue;">= </span><span style="color:black;">t.schema_id<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">t.name </span><span style="color:blue;">= </span><span style="color:magenta;">OBJECT_NAME</span><span style="color:gray;">(</span><span style="color:black;">46623209</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Before I continue let me say I do not see anything wrong with this script. It is just fine and one of the way to get SchemaName from Object ID.</p>
<p style="text-align:justify;">However, I have been using function OBJECT_SCHEMA_NAME to get the schema name. If I have to write the same code from the beginning I would have written the same code as following.</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:black;">OBJECT_SCHEMA_NAME</span><span style="color:gray;">(</span><span style="color:black;">46623209</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">SchemaName</span><span style="color:gray;">, </span><span style="color:black;">t.name </span><span style="color:blue;">AS </span><span style="color:black;">TableName</span><span style="color:gray;">,<br />
</span><span style="color:black;">t.schema_id</span><span style="color:gray;">, </span><span style="color:black;">t.</span><span style="color:magenta;">OBJECT_ID<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.tables t<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">t.name </span><span style="color:blue;">= </span><span style="color:magenta;">OBJECT_NAME</span><span style="color:gray;">(</span><span style="color:black;">46623209</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Now, both of the above code give you exact same result. If you remove the WHERE condition it will give you information of all the tables of the database.</p>
<p style="text-align:justify;">Now the question is which one is better &#8211; honestly &#8211; it is not about one is better than other. Use the one which you prefer to use. I prefer to use second one as it requires less typing. Let me ask you the same question to you &#8211; which method to get schema name do yo use? and Why?</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>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-server/'>SQL Server</a>, <a href='http://blog.sqlauthority.com/category/sql-system-table/'>SQL System Table</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/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/18678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18678/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18678&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/XxQKzCrkWHjN5-2lx00UXIjw2JI/0/da"><img src="http://feedads.g.doubleclick.net/~a/XxQKzCrkWHjN5-2lx00UXIjw2JI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/XxQKzCrkWHjN5-2lx00UXIjw2JI/1/da"><img src="http://feedads.g.doubleclick.net/~a/XxQKzCrkWHjN5-2lx00UXIjw2JI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=RxmI8GKkgOE:mEjSyvUyh_Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=RxmI8GKkgOE:mEjSyvUyh_Q:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=RxmI8GKkgOE:mEjSyvUyh_Q:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=RxmI8GKkgOE:mEjSyvUyh_Q:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=RxmI8GKkgOE:mEjSyvUyh_Q:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/RxmI8GKkgOE" height="1" width="1"/>]]></content:encoded><description>Sometime a simple solution have even simpler solutions but we often do not practice it as we do not see value in it or find it useful. Well, today&amp;#8217;s blog post is also about something which I have seen not practiced much in codes. We are so much comfortable with alternative usage that we do [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18678&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/15/sql-server-get-schema-name-from-object-id-using-object_schema_name/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><feedburner:origLink>http://blog.sqlauthority.com/2012/05/15/sql-server-get-schema-name-from-object-id-using-object_schema_name/</feedburner:origLink></item><item><title>SQL SERVER – Columnstore Index and sys.dm_db_index_usage_stats</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/hfWU4YNbAcw/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Index</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Sun, 13 May 2012 18:30:03 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18649</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">As you know I have been writing on Columnstore Index for quite a while. Recently my friend Vinod Kumar wrote about  <strong><a title="Permanent Link to SQL Server 2012: ColumnStore Characteristics" href="http://blogs.extremeexperts.com/2012/05/10/sql-server-2012-columnstore-characteristics/" rel="bookmark">SQL Server 2012: ColumnStore Characteristics</a></strong>. A fantastic read on the subject if you have yet not caught up on that subject. After the blog post I called him and asked what should I write next on this subject. He suggested that I should write on DMV script which I have prepared related to Columnstore when I was writing our SQL Server Questions and Answers book. When we were writing this book SQL Server 2012 CTP versions were available. I had written few scripts related to SQL Server columnstore Index. I like Vinod&#8217;s idea and I decided to write about DMV, which we did not cover in the book as SQL Server 2012 was not released yet. We did not want to talk about the product which was not yet released.</p>
<p style="text-align:justify;">The first script which I had written was with DMV - sys.column_store_index_stats. This DMV was displaying the statistics of the columnstore indexes. When I attempted to run it on SQL Server 2012 RTM it gave me error suggesting that this DMV does not exists.</p>
<p style="text-align:justify;">Here is the script which I ran:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.column_store_index_stats</span><span style="color:gray;">;</span></code></p>
<p style="text-align:justify;">It generated following error:</p>
<p style="text-align:justify;"><span style="color:#ff0000;">Msg 208, Level 16, State 1, Line 1</span><br />
<span style="color:#ff0000;"> Invalid object name &#8216;column_store_index_stats&#8217;.</span></p>
<p style="text-align:justify;">I was pretty confident that this DMV was available when I had written the scripts. The next reaction was to type &#8216;sys.&#8217; only in SSMS and wait for intelisense to popup DMV list. I scrolled down and noticed that above said DMV did not exists there as well.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/columndmv.png" alt="" width="453" height="293" /></p>
<p style="text-align:justify;"><strong>Now this is not bug or missing feature.</strong> This was indeed something can happen because the version which I was practicing was early CTP version. If you go to the page of the DMV <a href="http://msdn.microsoft.com/en-us/library/gg492074.aspx" target="_blank">here</a>, it clearly stats notice on the top of the page.</p>
<p style="padding-left:30px;text-align:justify;">This documentation is for preview only, and is subject to change in later releases.</p>
<p style="text-align:justify;">Now this was not alarming but my next thought was if this DMV is not there where can I find the information which this DMV was providing. Well, while I was thinking about this, I noticed that my another friend <strong><a href="http://sqlserver-help.com/" target="_blank">Balmukund Lakhani</a></strong> was online on personal messenger. Well, Balmukund is &#8220;Know All&#8221; kid. I have yet to find situation where I have not got my answers from him. I immediately pinged him and asked the question regarding where can I find information of &#8216;column_store_index_stats&#8217;. His answer was very abrupt but enlightening for sure. Here is our conversation:</p>
<p style="text-align:justify;"><em><strong>Pinal</strong>: Where can I find information of column_store_index_stats?</em><br />
<em><strong>Balmukund</strong>: Assume you have never worked with CTP before and now try to find the information which you are trying to find.</em></p>
<p style="text-align:justify;">Honestly  it was fantastic response from him. I was confused as I have played extensively with CTP versions of SQL Server 2012. Now his response give me big hint. I should have not looked for DMV but rather should have focused on what I wanted to do. I wanted to retrieve the statistics related to the index. In SQL Server 2008/R2, I was able to retrieve the statistics of the index from the DMV - sys.dm_db_index_usage_stats. I used the same DMV on SQL Server 2012 and it did retrieved the necessary information for me.</p>
<p style="text-align:justify;">Here is the updated script which gave me all the necessary information I was looking for. Matter of the fact, if I have used my earlier SQL Server 2008 R2 script this would have just worked fine.</p>
<p><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">DB_NAME</span><span style="color:gray;">(</span><span style="color:black;">Database_ID</span><span style="color:gray;">) </span><span style="color:black;">DBName</span><span style="color:gray;">,<br />
</span><span style="color:black;">SCHEMA_NAME</span><span style="color:gray;">(</span><span style="color:black;">schema_id</span><span style="color:gray;">) </span><span style="color:blue;">AS </span><span style="color:black;">SchemaName</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">OBJECT_NAME</span><span style="color:gray;">(</span><span style="color:black;">ius.</span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">) </span><span style="color:black;">ObjName</span><span style="color:gray;">,<br />
</span><span style="color:black;">i.type_desc</span><span style="color:gray;">, </span><span style="color:black;">i.name</span><span style="color:gray;">,<br />
</span><span style="color:black;">user_seeks</span><span style="color:gray;">, </span><span style="color:black;">user_scans</span><span style="color:gray;">,<br />
</span><span style="color:black;">user_lookups</span><span style="color:gray;">, </span><span style="color:black;">user_updates</span><span style="color:gray;">,*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.dm_db_index_usage_stats ius<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">sys.indexes i<br />
</span><span style="color:blue;">ON </span><span style="color:black;">i.index_id </span><span style="color:blue;">= </span><span style="color:black;">ius.index_id<br />
</span><span style="color:gray;">AND </span><span style="color:black;">ius.</span><span style="color:magenta;">OBJECT_ID </span><span style="color:blue;">= </span><span style="color:black;">i.</span><span style="color:magenta;">OBJECT_ID<br />
</span><span style="color:blue;">INNER JOIN </span><span style="color:black;">sys.tables t </span><span style="color:blue;">ON </span><span style="color:black;">t.</span><span style="color:magenta;">OBJECT_ID </span><span style="color:blue;">= </span><span style="color:black;">i.</span><span style="color:magenta;">OBJECT_ID<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Let us see the resultset of above query.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/columndmv1.png" alt="" width="500" height="117" /></p>
<p style="text-align:justify;">You will notice that column Type_desc describes the type of the index. You can additionally write WHERE condition on the column and only retrieve only selected type of Index.</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>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-index/'>SQL Index</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</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/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/18649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18649/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18649/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18649/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18649&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/Z8C1CKvBJJTFbUXArAOp2Uj26OI/0/da"><img src="http://feedads.g.doubleclick.net/~a/Z8C1CKvBJJTFbUXArAOp2Uj26OI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Z8C1CKvBJJTFbUXArAOp2Uj26OI/1/da"><img src="http://feedads.g.doubleclick.net/~a/Z8C1CKvBJJTFbUXArAOp2Uj26OI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=hfWU4YNbAcw:IDy7ihdeb8I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=hfWU4YNbAcw:IDy7ihdeb8I:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=hfWU4YNbAcw:IDy7ihdeb8I:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=hfWU4YNbAcw:IDy7ihdeb8I:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=hfWU4YNbAcw:IDy7ihdeb8I:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/hfWU4YNbAcw" height="1" width="1"/>]]></content:encoded><description>As you know I have been writing on Columnstore Index for quite a while. Recently my friend Vinod Kumar wrote about  SQL Server 2012: ColumnStore Characteristics. A fantastic read on the subject if you have yet not caught up on that subject. After the blog post I called him and asked what should I write [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18649&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/14/sql-server-columnstore-index-and-sys-dm_db_index_usage_stats/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/columndmv.png" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/columndmv1.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/14/sql-server-columnstore-index-and-sys-dm_db_index_usage_stats/</feedburner:origLink></item><item><title>SQLAuthority News – Download Whitepaper – Choosing a Tabular or Multidimensional Modeling Experience in SQL Server 2012 Analysis Services</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/DfeJwcopBDc/</link><category>Business Intelligence</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>SQL White Papers</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Sat, 12 May 2012 18:30:59 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18638</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">Data modeling is the most important task for any BI professional. Matter of the fact, the biggest challenge is to organizing disparate data into an analytic model that effectively and efficiently supports the reporting and analysis. SQL Server 2012 introduces BI Semantic Model (BISM), a single model that can support a broad range of reporting and analysis while blending two Analysis Services modeling experiences behind the scenes.</p>
<ul style="text-align:justify;">
<li>Multidimensional modeling &#8211; enables BI professionals to create sophisticated multidimensional cubes using traditional online analytical processing (OLAP).</li>
<li>Tabular modeling &#8211; provides self-service data modeling capabilities to business and data analysts.</li>
</ul>
<div style="text-align:justify;">As data modeling is evolving and business needs are growing new technologies and tools are emerging to help end users to make the necessary adjustment to the reporting and analysis needs. This white paper is will provide practical guidance to help you decide which SQL Server 2012 Analysis Services modeling experience – tabular or multidimensional.</div>
<p style="text-align:justify;">Do let me know what do is your opinion as a comment. In simple word &#8211; I would like to know when will you use Tabular modeling and when Multidimensional modeling?</p>
<p style="text-align:justify;"><a href="http://download.microsoft.com/download/D/2/0/D20E1C5F-72EA-4505-9F26-FEF9550EFD44/SQL2012AS%20Multidimensional%20Modeling.docx" target="_blank">Download Choosing a Tabular or Multidimensional Modeling Experience in SQL Server 2012 Analysis Services</a></p>
<p style="text-align:justify;">Reference:<strong></strong> <strong>Pinal Dave (<a href="http://blog.sqlauthority.com/" target="_blank">http://blog.SQLAuthority.com</a>)</strong></p>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/business-intelligence/'>Business Intelligence</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/sql-white-papers/'>SQL White Papers</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/18638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18638/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18638&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/VErHi1p9HUw4kLSSiwF_8DTt0yU/0/da"><img src="http://feedads.g.doubleclick.net/~a/VErHi1p9HUw4kLSSiwF_8DTt0yU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VErHi1p9HUw4kLSSiwF_8DTt0yU/1/da"><img src="http://feedads.g.doubleclick.net/~a/VErHi1p9HUw4kLSSiwF_8DTt0yU/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=DfeJwcopBDc:ytT5h7wKi_0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=DfeJwcopBDc:ytT5h7wKi_0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=DfeJwcopBDc:ytT5h7wKi_0:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=DfeJwcopBDc:ytT5h7wKi_0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=DfeJwcopBDc:ytT5h7wKi_0:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/DfeJwcopBDc" height="1" width="1"/>]]></content:encoded><description>Data modeling is the most important task for any BI professional. Matter of the fact, the biggest challenge is to organizing disparate data into an analytic model that effectively and efficiently supports the reporting and analysis. SQL Server 2012 introduces BI Semantic Model (BISM), a single model that can support a broad range of reporting and analysis [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18638&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/13/sqlauthority-news-download-whitepaper-choosing-a-tabular-or-multidimensional-modeling-experience-in-sql-server-2012-analysis-services/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><feedburner:origLink>http://blog.sqlauthority.com/2012/05/13/sqlauthority-news-download-whitepaper-choosing-a-tabular-or-multidimensional-modeling-experience-in-sql-server-2012-analysis-services/</feedburner:origLink></item><item><title>SQL SERVER – Developer Training Kit for SQL Server 2012</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/kszrzvk3amg/</link><category>Developer Training</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Documentation</category><category>SQL Download</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>SQLAuthority News</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Fri, 11 May 2012 18:30:09 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18614</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">Developer Training Kit is my favorite part of any product. The reason behind is very simple because it give the single resource which gives complete overview of the product in nutshell. A developer can learn from many places &#8211; books, webcasts, tutorials, blogs, etc. However, I have found that developer training kits are the best starting point for any product. Start with them first, see what are the new features as well what is the new message a product is coming up with. Once it is learned the very next step should be to identify the right learning material to explore the preferred topic.</p>
<p style="text-align:justify;">The SQL Server 2012 Developer Training Kit includes technical content including labs, demos and presentations designed to help you learn how to develop SQL Server 2012 database and BI solutions. New and updated content will be released periodically and can be downloaded on-demand using the Web Installer.</p>
<p style="text-align:justify;"><a href="http://www.microsoft.com/en-us/download/details.aspx?id=27721" target="_blank">Download SQL Server 2012 Developer Training Kit Web Installer</a>.</p>
<p style="text-align:justify;">This training kit was available earlier this year but it is never late to explore it if you have not referred it earlier. Additionally, if you do not want to download complete kit all together I suggest you refer to Wiki here. This wiki contains all the same presentations and demo notes which web installer contains.</p>
<p style="text-align:justify;"><a href="http://social.technet.microsoft.com/wiki/contents/articles/6982.sql-server-2012-developer-training-kit-bom-en-us.aspx" target="_blank">Refer to SQL Server 2012 Developer Training Kit Wiki</a></p>
<p style="text-align:justify;">Wiki contains following module and details about Hands On Labs<br />
Module 1: Introduction to SQL Server 2012<br />
Module 2: Introduction to SQL Server 2012 AlwaysOn<br />
Module 3: Exploring and Managing SQL Server 2012 Database Engine Improvements<br />
Module 4: SQL Server 2012 Database Server Programmability<br />
Module 5: SQL Server 2012 Application Development<br />
Module 6: SQL Server 2012 Enterprise Information Management<br />
Module 7: SQL Server 2012 Business Intelligence<br />
Hands-On Labs: SQL Server 2012 Database Engine<br />
Hands-On Labs: Visual Studio 2010 and .NET 4.0<br />
Hands-On Labs: SQL Server 2012 Enterprise Information Management<br />
Hands-On Labs: SQL Server 2012 Business Intelligence<br />
Hands-On LabsHands-On Labs: Windows Azure and SQL Azure</p>
<p style="text-align:justify;">As I said, if you have not downloaded this so far, it is never late to explore it. Trust me you will atleast learn one thing if you just explore the content.</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 />Filed under: <a href='http://blog.sqlauthority.com/category/developer-training/'>Developer Training</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-documentation/'>SQL Documentation</a>, <a href='http://blog.sqlauthority.com/category/sql-download/'>SQL Download</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</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/sqlauthority/sqlauthority-news/'>SQLAuthority News</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/18614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18614/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18614/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18614/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18614/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18614/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18614/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18614/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18614/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18614&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/XRQRKvkDupuFO4l6cqQWCwoTRhc/0/da"><img src="http://feedads.g.doubleclick.net/~a/XRQRKvkDupuFO4l6cqQWCwoTRhc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/XRQRKvkDupuFO4l6cqQWCwoTRhc/1/da"><img src="http://feedads.g.doubleclick.net/~a/XRQRKvkDupuFO4l6cqQWCwoTRhc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=kszrzvk3amg:a4scie2hFcw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=kszrzvk3amg:a4scie2hFcw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=kszrzvk3amg:a4scie2hFcw:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=kszrzvk3amg:a4scie2hFcw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=kszrzvk3amg:a4scie2hFcw:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/kszrzvk3amg" height="1" width="1"/>]]></content:encoded><description>Developer Training Kit is my favorite part of any product. The reason behind is very simple because it give the single resource which gives complete overview of the product in nutshell. A developer can learn from many places &amp;#8211; books, webcasts, tutorials, blogs, etc. However, I have found that developer training kits are the best [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18614&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/12/sql-server-developer-training-kit-for-sql-server-2012/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><feedburner:origLink>http://blog.sqlauthority.com/2012/05/12/sql-server-developer-training-kit-for-sql-server-2012/</feedburner:origLink></item><item><title>SQL SERVER – Quiz and Video – Introduction to Discovering XML Data Type Methods</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/7LhplYcq_AU/</link><category>Joes 2 Pros</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Thu, 10 May 2012 18:30:42 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18585</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<div>
<p style="text-align:justify;">This blog post is inspired from <strong><a title="Permanent Link to SQL Interoperability Joes 2 Pros: A Guide to Integrating SQL Server with XML, C#, and PowerShell  – SQL Exam Prep Series 70-433 – Volume 5" href="http://blog.sqlauthority.com/sql-server-books/sql-interoperability-joes-2-pros-a-guide-to-integrating-sql-server-with-xml-c-and-powershell-sql-exam-prep-series-70-433-volume-5/" rel="bookmark">SQL Interoperability Joes 2 Pros: A Guide to Integrating SQL Server with XML, C#, and PowerShell – SQL Exam Prep Series 70-433 – Volume 5</a></strong>.</p>
<p style="text-align:justify;"><strong>[<a href="http://amzn.to/j2p-5" target="_blank">Amazon</a>] | [<a href="http://bit.ly/pinalbook5" target="_blank">Flipkart</a>] | [<a href="http://amzn.to/sqlbook5onkindle" target="_blank">Kindle</a>] | [<a href="http://bit.ly/ip-j2p-5" target="_blank">IndiaPlaza</a>]</strong></p>
</div>
<p style="text-align:justify;">This is follow up blog post of my earlier blog post on the same subject - <strong><a href="http://blog.sqlauthority.com/2012/04/27/sql-server-introduction-to-discovering-xml-data-type-methods-a-primer/">SQL SERVER – Introduction to Discovering XML Data Type Methods – A Primer</a></strong>. In the article we discussed various basics terminology of the XML. The article further covers following important concepts of XML.</p>
<ul style="text-align:justify;">
<li>What are XML Data Type Methods</li>
<li>The query() Method</li>
<li>The value() Method</li>
<li>The exist() Method</li>
<li>The modify() Method</li>
</ul>
<p style="text-align:justify;">Above five are the most important concepts related to XML and SQL Server. There are many more things one has to learn but without beginners fundamentals one can&#8217;t learn the advanced  concepts. Let us have small quiz and check how many of you get the fundamentals right.</p>
<h3 style="text-align:justify;">Quiz</h3>
<p style="text-align:justify;"><strong>1.) Which method returns an XML fragment from the source XML?</strong></p>
<ol style="text-align:justify;">
<li>query( )</li>
<li>value( )</li>
<li>exist( )</li>
<li>modify( )</li>
<li>All of them</li>
<li>Only query( ) and value( )</li>
</ol>
<p style="text-align:justify;"><strong>2.) Which XML data type method returns a “1” if found and “0” if the specified XPath is not found in the source XML?</strong></p>
<ol style="text-align:justify;">
<li>query( )</li>
<li>value( )</li>
<li>exist( )</li>
<li>modify( )</li>
<li>All of them</li>
<li>Only query( ) and value( )</li>
</ol>
<p style="text-align:justify;"><strong>3.) Which XML data type method allows you to pick the data type of the value that is returned from the source XML?</strong></p>
<ol style="text-align:justify;">
<li>query( )</li>
<li>value( )</li>
<li>exist( )</li>
<li>modify( )</li>
<li>All of them</li>
<li>Only query( ) and value( )</li>
</ol>
<p style="text-align:justify;"><strong>4.) Which method will not work with a SQL SELECT statement?</strong></p>
<ol style="text-align:justify;">
<li>query( )</li>
<li>value( )</li>
<li>exist( )</li>
<li>modify( )</li>
<li>All of them</li>
<li>Only query( ) and value( )</li>
</ol>
<p style="text-align:justify;">Now make sure that you write down all the answers on the piece of paper.</p>
<div style="text-align:justify;">
<p>Watch following video and read earlier article over here. If you want to change the answer you still have chance.</p>
<span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/11/sql-server-quiz-and-video-introduction-to-discovering-xml-data-type-methods/"><img src="http://img.youtube.com/vi/0g61qFIOL0o/2.jpg" alt="" /></a></span>
<h3>Solution</h3>
<p>1) 1</p>
<p>2) 3</p>
<p>3) 2</p>
<p>4) 4</p>
<p>Now compare let us check the answers and compare your answers to following answers. I am very confident you will get them correct.</p>
</div>
<h3 style="text-align:justify;"><a href="http://blog.sqlauthority.com/sql-server-books/sql-joes-2-pros-five-book-combo-list-of-best-sql-server-books/"><img class="alignleft" src="http://www.pinaldave.com/bimg/j2pimages/combos.png" alt="" width="250" height="160" /></a></h3>
<div style="text-align:justify;">
<p><strong>Available at</strong></p>
<p><strong>USA: <a href="http://amzn.to/sqlfiveamazon" target="_blank">Amazon</a></strong></p>
<p><strong>India: <a href="http://bit.ly/sqlfiveflipkart" target="_blank">Flipkart </a>| <a href="http://bit.ly/ip-fivebooks" target="_blank">IndiaPlaza</a></strong></p>
<p><strong>Volume: <a href="http://bit.ly/sa-book1" target="_blank">1</a>, <a href="http://bit.ly/sa-book2" target="_blank">2</a>, <a href="http://bit.ly/sa-book3" target="_blank">3</a>, <a href="http://bit.ly/sa-book4" target="_blank">4</a>, <a href="http://bit.ly/sa-book5" target="_blank">5</a></strong></p>
<p>Please leave your feedback in the comment area for the quiz and video. Did you know all the answers of the quiz?</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 />Filed under: <a href='http://blog.sqlauthority.com/category/joes-2-pros/'>Joes 2 Pros</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/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/18585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18585/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18585/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18585&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/Kzx9CB1r0ydpIKb72-U5PhLXeGE/0/da"><img src="http://feedads.g.doubleclick.net/~a/Kzx9CB1r0ydpIKb72-U5PhLXeGE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Kzx9CB1r0ydpIKb72-U5PhLXeGE/1/da"><img src="http://feedads.g.doubleclick.net/~a/Kzx9CB1r0ydpIKb72-U5PhLXeGE/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7LhplYcq_AU:xFjh6NQ2adU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7LhplYcq_AU:xFjh6NQ2adU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7LhplYcq_AU:xFjh6NQ2adU:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7LhplYcq_AU:xFjh6NQ2adU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=7LhplYcq_AU:xFjh6NQ2adU:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/7LhplYcq_AU" height="1" width="1"/>]]></content:encoded><description>This blog post is inspired from SQL Interoperability Joes 2 Pros: A Guide to Integrating SQL Server with XML, C#, and PowerShell – SQL Exam Prep Series 70-433 – Volume 5. [Amazon] &amp;#124; [Flipkart] &amp;#124; [Kindle] &amp;#124; [IndiaPlaza] This is follow up blog post of my earlier blog post on the same subject - SQL SERVER – Introduction [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18585&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/11/sql-server-quiz-and-video-introduction-to-discovering-xml-data-type-methods/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/j2pimages/combos.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/11/sql-server-quiz-and-video-introduction-to-discovering-xml-data-type-methods/</feedburner:origLink></item><item><title>SQL SERVER – Quiz and Video – Introduction to SQL Error Actions</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/k7KjKucfSys/</link><category>Joes 2 Pros</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Wed, 09 May 2012 18:30:26 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18573</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<div>
<p style="text-align:justify;">This blog post is inspired from <strong><a title="Permanent Link to SQL Programming Joes 2 Pros: Programming and Development for Microsoft SQL Server 2008 – SQL Exam Prep Series 70-433 – Volume 4" href="http://blog.sqlauthority.com/sql-server-books/sql-programming-joes-2-pros-programming-and-development-for-microsoft-sql-server-2008-sql-exam-prep-series-70-433-volume-4/" rel="bookmark">SQL Programming Joes 2 Pros: Programming and Development for Microsoft SQL Server 2008 – SQL Exam Prep Series 70-433 – Volume 4</a></strong>.</p>
<p style="text-align:justify;"><strong>[<a href="http://amzn.to/j2p-4" target="_blank">Amazon</a>] | [<a href="http://bit.ly/pinalbook4" target="_blank">Flipkart</a>] | [<a href="http://amzn.to/sqlbook4onkindle" target="_blank">Kindle</a>] | [<a href="http://bit.ly/ip-j2p-4" target="_blank">IndiaPlaza</a>]</strong></p>
</div>
<p style="text-align:justify;">This is follow up blog post of my earlier blog post on the same subject - <strong><a href="http://blog.sqlauthority.com/2012/04/26/sql-server-introduction-to-sql-error-actions-a-primer/">SQL SERVER – Introduction to SQL Error Actions – A Primer</a></strong>. In the article we discussed various basics terminology of the error handling. The article further covers following important concepts of error handling.</p>
<ul style="text-align:justify;">
<li>Introduction to SQL Error Actions</li>
<li>Statement Termination</li>
<li>Scope Abortion</li>
<li>Batch Termination</li>
</ul>
<p style="text-align:justify;">Above three are the most important concepts related to error handling and SQL Server.  There are many more things one has to learn but without beginners fundamentals one can&#8217;t learn the advanced concepts. Let us have small quiz and check how many of you get the fundamentals right.</p>
<h3 style="text-align:justify;">Quiz</h3>
<p style="text-align:justify;"><strong>1.) Which SQL Server error action happens for errors with a severity of 11-16 when you set the XACT_ABORT setting to ON?</strong></p>
<ol style="text-align:justify;">
<li>You will get Statement Termination.</li>
<li>You will get Scope Abortion.</li>
<li>You will get Batch Abortion.</li>
<li>You will get Connection Termination.</li>
<li>SQL Server will pick the error action.</li>
</ol>
<p style="text-align:justify;"><strong>2.) Which SQL Server error action happens for errors with a severity of 11-16 when you set the XACT_ABORT setting to OFF?</strong></p>
<ol style="text-align:justify;">
<li>You will get Statement Termination</li>
<li>You will get Scope Abortion</li>
<li>You will get Batch Abortion</li>
<li>You will get Connection Termination</li>
<li>SQL Server will pick the error action</li>
</ol>
<div style="text-align:justify;">
<p>Now make sure that you write down all the answers on the piece of paper.</p>
<p>Watch following video and read earlier article over here. If you want to change the answer you still have chance.</p>
<span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/10/sql-server-quiz-and-video-introduction-to-sql-error-actions/"><img src="http://img.youtube.com/vi/fPjOhr3b5Pk/2.jpg" alt="" /></a></span>
<h3>Solution</h3>
<p>1) 3</p>
<p>2) 5</p>
<p>Now compare let us check the answers and compare your answers to following answers. I am very confident you will get them correct.</p>
</div>
<h3 style="text-align:justify;"><a href="http://blog.sqlauthority.com/sql-server-books/sql-joes-2-pros-five-book-combo-list-of-best-sql-server-books/"><img class="alignleft" src="http://www.pinaldave.com/bimg/j2pimages/combos.png" alt="" width="250" height="160" /></a></h3>
<div style="text-align:justify;">
<p><strong>Available at</strong></p>
<p><strong>USA: <a href="http://amzn.to/sqlfiveamazon" target="_blank">Amazon</a></strong></p>
<p><strong>India: <a href="http://bit.ly/sqlfiveflipkart" target="_blank">Flipkart </a>| <a href="http://bit.ly/ip-fivebooks" target="_blank">IndiaPlaza</a></strong></p>
<p><strong>Volume: <a href="http://bit.ly/sa-book1" target="_blank">1</a>, <a href="http://bit.ly/sa-book2" target="_blank">2</a>, <a href="http://bit.ly/sa-book3" target="_blank">3</a>, <a href="http://bit.ly/sa-book4" target="_blank">4</a>, <a href="http://bit.ly/sa-book5" target="_blank">5</a></strong></p>
<p>Please leave your feedback in the comment area for the quiz and video. Did you know all the answers of the quiz?</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 />Filed under: <a href='http://blog.sqlauthority.com/category/joes-2-pros/'>Joes 2 Pros</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/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/18573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18573/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18573/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18573/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18573&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/7_rsrCzrVND5-j3THgvFCIi9XZg/0/da"><img src="http://feedads.g.doubleclick.net/~a/7_rsrCzrVND5-j3THgvFCIi9XZg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7_rsrCzrVND5-j3THgvFCIi9XZg/1/da"><img src="http://feedads.g.doubleclick.net/~a/7_rsrCzrVND5-j3THgvFCIi9XZg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=k7KjKucfSys:QsWuR-f-Pzg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=k7KjKucfSys:QsWuR-f-Pzg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=k7KjKucfSys:QsWuR-f-Pzg:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=k7KjKucfSys:QsWuR-f-Pzg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=k7KjKucfSys:QsWuR-f-Pzg:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/k7KjKucfSys" height="1" width="1"/>]]></content:encoded><description>This blog post is inspired from SQL Programming Joes 2 Pros: Programming and Development for Microsoft SQL Server 2008 – SQL Exam Prep Series 70-433 – Volume 4. [Amazon] &amp;#124; [Flipkart] &amp;#124; [Kindle] &amp;#124; [IndiaPlaza] This is follow up blog post of my earlier blog post on the same subject - SQL SERVER – Introduction to SQL Error [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18573&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/10/sql-server-quiz-and-video-introduction-to-sql-error-actions/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/j2pimages/combos.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/10/sql-server-quiz-and-video-introduction-to-sql-error-actions/</feedburner:origLink></item><item><title>SQL SERVER – Quiz and Video – Introduction to Basics of a Query Hint</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/m5_NDlxQ7VI/</link><category>Joes 2 Pros</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Tue, 08 May 2012 18:30:42 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18560</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<div>
<p>This blog post is inspired from <strong><a title="Permanent Link to SQL Architecture Basics Joes 2 Pros: Core Architecture concepts – SQL Exam Prep Series 70-433 – Volume 3" href="http://blog.sqlauthority.com/sql-server-books/sql-architecture-basics-joes-2-pros-core-architecture-concepts-sql-exam-prep-series-70-433-volume-3/" rel="bookmark">SQL Architecture Basics Joes 2 Pros: Core Architecture concepts – SQL Exam Prep Series 70-433 – Volume 3</a></strong>.</p>
<p><strong>[<a href="http://amzn.to/j2p-3" target="_blank">Amazon</a>] | [<a href="http://bit.ly/pinalbook3" target="_blank">Flipkart</a>] | [<a href="http://amzn.to/sqlbook3onkindle" target="_blank">Kindle</a>] | [<a href="http://bit.ly/ip-j2p-3" target="_blank">IndiaPlaza</a>]</strong></p>
</div>
<p style="text-align:justify;">This is follow up blog post of my earlier blog post on the same subject - <strong><a href="http://blog.sqlauthority.com/2012/04/25/sql-server-introduction-to-basics-of-a-query-hint-a-primer/" target="_blank">SQL SERVER – Introduction to Basics of a Query Hint – A Primer</a></strong>. In the article we discussed various basics terminology of the query hints. The article further covers following important concepts of query hints.</p>
<ul style="text-align:justify;">
<li>Expecting Seek and getting a Scan</li>
<li>Creating an index for improved optimization</li>
<li>Implementing the query hint</li>
</ul>
<p style="text-align:justify;">Above three are the most important concepts related to query hint and SQL Server.  There are many more things one has to learn but without beginners fundamentals one can&#8217;t learn the advanced  concepts. Let us have small quiz and check how many of you get the fundamentals right.</p>
<h3 style="text-align:justify;">Quiz</h3>
<p style="text-align:justify;"><strong>1) You have the following query:</strong></p>
<p><strong>DECLARE @UlaChoice TinyInt</strong><br />
<strong> SET @Type = 1</strong><br />
<strong> SELECT *</strong><br />
<strong> FROM LegalActivity</strong><br />
<strong> WHERE UlaChoice = @UlaChoice</strong></p>
<p><strong>You have a nonclustered index named IX_Legal_Ula on the UlaChoice field. The Primary key is on the ID field and called PK_Legal_ID 99% of the time the value of the @UlaChoice is set to &#8216;YP101&#8242;. What query will achieve the best optimization for this query?</strong></p>
<ol>
<li>SELECT *<br />
FROM LegalActivity<br />
WHERE UlaChoice = @UlaChoice<br />
WITH(INDEX(X_Legal_Ula))</li>
<li>SELECT *<br />
FROM LegalActivity<br />
WHERE UlaChoice = @UlaChoice<br />
WITH(INDEX(PK_Legal_ID))</li>
<li>SELECT *<br />
FROM LegalActivity<br />
WHERE UlaChoice = @UlaChoice<br />
OPTION (Optimize FOR(@UlaChoice = &#8216;YP101&#8242;))</li>
</ol>
<p style="text-align:justify;"><strong>2) You have the following query:</strong></p>
<p><strong>SELECT *</strong><br />
<strong> FROM CurrentProducts</strong><br />
<strong> WHERE ShortName = &#8216;Yoga Trip&#8217;</strong></p>
<p><strong>You have a nonclustered index on the ShortName field and the query runs an efficient index seek. You change your query to use a variable for ShortName and now you are using a slow index scan.</strong></p>
<p><strong>What query hint can you use to get the same execution time as before?</strong></p>
<ol>
<li>WITH</li>
<li>LOCK</li>
<li>FAST</li>
<li>OPTIMIZE FOR</li>
<li>MAXDOP</li>
<li>READONLY</li>
</ol>
<div style="text-align:justify;">
<p>Now make sure that you write down all the answers on the piece of paper.</p>
<p>Watch following video and read earlier article over here. If you want to change the answer you still have chance.</p>
<span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/"><img src="http://img.youtube.com/vi/0GTeUHkdZtc/2.jpg" alt="" /></a></span>
<h3>Solution</h3>
<p>1) 3</p>
<p>2) 4</p>
<p>Now compare let us check the answers and compare your answers to following answers. I am very confident you will get them correct.</p>
</div>
<h3 style="text-align:justify;"><a href="http://blog.sqlauthority.com/sql-server-books/sql-joes-2-pros-five-book-combo-list-of-best-sql-server-books/"><img class="alignleft" src="http://www.pinaldave.com/bimg/j2pimages/combos.png" alt="" width="250" height="160" /></a></h3>
<div style="text-align:justify;">
<p><strong>Available at</strong></p>
<p><strong>USA: <a href="http://amzn.to/sqlfiveamazon" target="_blank">Amazon</a></strong></p>
<p><strong>India: <a href="http://bit.ly/sqlfiveflipkart" target="_blank">Flipkart </a>| <a href="http://bit.ly/ip-fivebooks" target="_blank">IndiaPlaza</a></strong></p>
<p><strong>Volume: <a href="http://bit.ly/sa-book1" target="_blank">1</a>, <a href="http://bit.ly/sa-book2" target="_blank">2</a>, <a href="http://bit.ly/sa-book3" target="_blank">3</a>, <a href="http://bit.ly/sa-book4" target="_blank">4</a>, <a href="http://bit.ly/sa-book5" target="_blank">5</a></strong></p>
<p>Please leave your feedback in the comment area for the quiz and video. Did you know all the answers of the quiz?</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 />Filed under: <a href='http://blog.sqlauthority.com/category/joes-2-pros/'>Joes 2 Pros</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/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/18560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18560/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18560&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/5kYQahvxOWimXu-sndiHGnp_sgg/0/da"><img src="http://feedads.g.doubleclick.net/~a/5kYQahvxOWimXu-sndiHGnp_sgg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/5kYQahvxOWimXu-sndiHGnp_sgg/1/da"><img src="http://feedads.g.doubleclick.net/~a/5kYQahvxOWimXu-sndiHGnp_sgg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=m5_NDlxQ7VI:yN7vcixVpA0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=m5_NDlxQ7VI:yN7vcixVpA0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=m5_NDlxQ7VI:yN7vcixVpA0:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=m5_NDlxQ7VI:yN7vcixVpA0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=m5_NDlxQ7VI:yN7vcixVpA0:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/m5_NDlxQ7VI" height="1" width="1"/>]]></content:encoded><description>This blog post is inspired from SQL Architecture Basics Joes 2 Pros: Core Architecture concepts – SQL Exam Prep Series 70-433 – Volume 3. [Amazon] &amp;#124; [Flipkart] &amp;#124; [Kindle] &amp;#124; [IndiaPlaza] This is follow up blog post of my earlier blog post on the same subject - SQL SERVER – Introduction to Basics of a Query Hint – [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18560&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/j2pimages/combos.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/09/sql-server-quiz-and-video-introduction-to-basics-of-a-query-hint/</feedburner:origLink></item><item><title>SQL SERVER – Quiz and Video – Introduction to Hierarchical Query using a Recursive CTE</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/L4s8h4hEjGU/</link><category>Joes 2 Pros</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Mon, 07 May 2012 18:30:29 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18546</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<div>This blog post is inspired from <strong><a title="Permanent Link to SQL Queries Joes 2 Pros: SQL Query Techniques For Microsoft SQL Server 2008 – SQL Exam Prep Series 70-433 – Volume 2" href="http://blog.sqlauthority.com/sql-server-books/sql-queries-joes-2-pros-sql-query-techniques-for-microsoft-sql-server-2008-sql-exam-prep-series-70-433-volume-2/" rel="bookmark">SQL Queries Joes 2 Pros: SQL Query Techniques For Microsoft SQL Server 2008 – SQL Exam Prep Series 70-433 – Volume 2</a></strong>.<strong>[<a href="http://amzn.to/j2p-1" target="_blank">Amazon</a>] | [<a href="http://bit.ly/pinalbook1" target="_blank">Flipkart</a>] | [<a href="http://amzn.to/sqlbook1onkindle" target="_blank">Kindle</a>] | [<a href="http://bit.ly/ip-j2p-1" target="_blank">IndiaPlaza</a>]</strong></div>
<p style="text-align:justify;">This is follow up blog post of my earlier blog post on the same subject - <strong><a href="http://blog.sqlauthority.com/2012/04/24/sql-server-introduction-to-hierarchical-query-using-a-recursive-cte-a-primer/">SQL SERVER – Introduction to Hierarchical Query using a Recursive CTE – A Primer</a></strong>. In the article we discussed various basics terminology of the CTE. The article further covers following important concepts of common table expression.</p>
<ul style="text-align:justify;">
<li>What is a Common Table Expression (CTE)</li>
<li>Building a Recursive CTE</li>
<li>Identify the Anchor and Recursive Query</li>
<li>Add the Anchor and Recursive query to a CTE</li>
<li>Add an expression to track hierarchical level</li>
<li>Add a self-referencing INNER JOIN statement</li>
</ul>
<p style="text-align:justify;">Above six are the most important concepts related to CTE and SQL Server.  There are many more things one has to learn but without beginners fundamentals one can&#8217;t learn the advanced  concepts. Let us have small quiz and check how many of you get the fundamentals right.</p>
<h3 style="text-align:justify;">Quiz</h3>
<p><strong>1) You have an employee table with the following data.</strong></p>
<table width="238" border="1" cellspacing="0" cellpadding="0">
<col width="47" />
<col width="71" />
<col width="75" />
<col width="45" />
<tbody>
<tr>
<td width="47" height="20"><strong>EmpID</strong></td>
<td width="71"><strong>FirstName</strong></td>
<td width="75"><strong>LastName</strong></td>
<td width="45"><strong>MgrID</strong></td>
</tr>
<tr>
<td height="20">1</td>
<td>David</td>
<td>Kennson</td>
<td>11</td>
</tr>
<tr>
<td height="20">2</td>
<td>Eric</td>
<td>Bender</td>
<td>11</td>
</tr>
<tr>
<td height="20">3</td>
<td>Lisa</td>
<td>Kendall</td>
<td>4</td>
</tr>
<tr>
<td height="20">4</td>
<td>David</td>
<td>Lonning</td>
<td>11</td>
</tr>
<tr>
<td height="20">5</td>
<td>John</td>
<td>Marshbank</td>
<td>4</td>
</tr>
<tr>
<td height="20">6</td>
<td>James</td>
<td>Newton</td>
<td>3</td>
</tr>
<tr>
<td height="20">7</td>
<td>Sally</td>
<td>Smith</td>
<td>NULL</td>
</tr>
</tbody>
</table>
<p>You need to write a recursive CTE that shows the EmpID, FirstName, LastName, MgrID, and employee level. The CEO should be listed at Level 1. All people who work for the CEO will be listed at Level 2. All of the people who work for those people will be listed at Level 3. Which CTE code will achieve this result?</p>
<ol>
<li>WITH EmpList AS<br />
(SELECT Boss.EmpID, Boss.FName, Boss.LName, Boss.MgrID,<br />
1 AS Lvl<br />
FROM Employee AS Boss WHERE Boss.MgrID IS NULL<br />
UNION ALL<br />
SELECT E.EmpID, E.FirstName, E.LastName, E.MgrID, EmpList.Lvl + 1<br />
FROM Employee AS E INNER JOIN EmpList<br />
ON E.MgrID = EmpList.EmpID)<br />
SELECT * FROM EmpList</li>
<li>WITH EmpListAS<br />
(SELECT EmpID, FirstName, LastName, MgrID, 1 as Lvl<br />
FROM Employee WHERE MgrID IS NULL<br />
UNION ALL<br />
SELECT EmpID, FirstName, LastName, MgrID, 2 as Lvl )<br />
SELECT * FROM BossList</li>
<li>WITH EmpList AS<br />
(SELECT EmpID, FirstName, LastName, MgrID, 1 as Lvl<br />
FROM Employee WHERE MgrID is NOT NULL<br />
UNION<br />
SELECT EmpID, FirstName, LastName, MgrID, BossList.Lvl + 1<br />
FROM Employee INNER JOIN EmpList BossList<br />
ON Employee.MgrID = BossList.EmpID)<br />
SELECT * FROM EmpList</li>
</ol>
<p><strong>2) You have a table named Employee. The EmployeeID of each employee&#8217;s manager is in the ManagerID column. You need to write a recursive query that produces a list of employees and their manager. The query must also include the employee&#8217;s level in the hierarchy.</strong> <strong>You write the following code segment:</strong></p>
<p><strong>WITH EmployeeList (EmployeeID, FullName, ManagerName, Level)<br />
</strong><strong>AS (<br />
</strong><strong>&#8211;PICK ANSWER CODE HERE<br />
</strong><strong>)</strong></p>
<ol>
<li>SELECT EmployeeID, FullName, &#8221; AS [ManagerID], 1 AS [Level]<br />
FROM Employee<br />
WHERE ManagerID IS NULL<br />
UNION ALL<br />
SELECT emp.EmployeeID, emp.FullName mgr.FullName, 1 + 1 AS [Level]<br />
FROM Employee emp JOIN Employee mgr<br />
ON emp.ManagerID = mgr.EmployeeId</li>
<li>SELECT EmployeeID, FullName, &#8221; AS [ManagerID], 1 AS [Level]<br />
FROM Employee<br />
WHERE ManagerID IS NULL<br />
UNION ALL<br />
SELECT emp.EmployeeID, emp.FullName, mgr.FullName, mgr.Level + 1<br />
FROM EmployeeList mgr JOIN Employee emp<br />
ON emp.ManagerID = mgr.EmployeeId</li>
</ol>
<div style="text-align:justify;">
<p>Now make sure that you write down all the answers on the piece of paper.</p>
<p>Watch following video and read earlier article over here. If you want to change the answer you still have chance.</p>
<span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/08/sql-server-quiz-and-video-introduction-to-hierarchical-query-using-a-recursive-cte/"><img src="http://img.youtube.com/vi/fbOGQlkFVqI/2.jpg" alt="" /></a></span>
<h3>Solution</h3>
<p>1) 1</p>
<p>2) 2</p>
<p>Now compare let us check the answers and compare your answers to following answers. I am very confident you will get them correct.</p>
</div>
<h3 style="text-align:justify;"><a href="http://blog.sqlauthority.com/sql-server-books/sql-joes-2-pros-five-book-combo-list-of-best-sql-server-books/"><img class="alignleft" src="http://www.pinaldave.com/bimg/j2pimages/combos.png" alt="" width="250" height="160" /></a></h3>
<div style="text-align:justify;">
<p><strong>Available at</strong></p>
<p><strong>USA: <a href="http://amzn.to/sqlfiveamazon" target="_blank">Amazon</a></strong></p>
<p><strong>India: <a href="http://bit.ly/sqlfiveflipkart" target="_blank">Flipkart </a>| <a href="http://bit.ly/ip-fivebooks" target="_blank">IndiaPlaza</a></strong></p>
<p><strong>Volume: <a href="http://bit.ly/sa-book1" target="_blank">1</a>, <a href="http://bit.ly/sa-book2" target="_blank">2</a>, <a href="http://bit.ly/sa-book3" target="_blank">3</a>, <a href="http://bit.ly/sa-book4" target="_blank">4</a>, <a href="http://bit.ly/sa-book5" target="_blank">5</a></strong></p>
<p>Please leave your feedback in the comment area for the quiz and video. Did you know all the answers of the quiz?</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 />Filed under: <a href='http://blog.sqlauthority.com/category/joes-2-pros/'>Joes 2 Pros</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/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/18546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18546/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18546&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/_NX2SPvWADSF_GlbEfgScs7zsG4/0/da"><img src="http://feedads.g.doubleclick.net/~a/_NX2SPvWADSF_GlbEfgScs7zsG4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_NX2SPvWADSF_GlbEfgScs7zsG4/1/da"><img src="http://feedads.g.doubleclick.net/~a/_NX2SPvWADSF_GlbEfgScs7zsG4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=L4s8h4hEjGU:pbIUwOkgXDY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=L4s8h4hEjGU:pbIUwOkgXDY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=L4s8h4hEjGU:pbIUwOkgXDY:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=L4s8h4hEjGU:pbIUwOkgXDY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=L4s8h4hEjGU:pbIUwOkgXDY:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/L4s8h4hEjGU" height="1" width="1"/>]]></content:encoded><description>This blog post is inspired from SQL Queries Joes 2 Pros: SQL Query Techniques For Microsoft SQL Server 2008 – SQL Exam Prep Series 70-433 – Volume 2.[Amazon] &amp;#124; [Flipkart] &amp;#124; [Kindle] &amp;#124; [IndiaPlaza] This is follow up blog post of my earlier blog post on the same subject - SQL SERVER – Introduction to Hierarchical Query using [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18546&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/08/sql-server-quiz-and-video-introduction-to-hierarchical-query-using-a-recursive-cte/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/j2pimages/combos.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/08/sql-server-quiz-and-video-introduction-to-hierarchical-query-using-a-recursive-cte/</feedburner:origLink></item><item><title>SQL SERVER – Quiz and Video – Introduction to SQL Server Security</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/7VIEPo05xUE/</link><category>Joes 2 Pros</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Sun, 06 May 2012 18:30:25 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18518</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<div>This blog post is inspired from <strong><a title="Permanent Link to Beginning SQL Joes 2 Pros: The SQL Hands-On Guide for Beginners – SQL Exam Prep Series 70-433 – Volume 1" href="http://blog.sqlauthority.com/sql-server-books/beginning-sql-joes-2-pros-the-sql-hands-on-guide-for-beginners-sql-exam-prep-series-70-433-volume-1/" rel="bookmark">Beginning SQL Joes 2 Pros: The SQL Hands-On Guide for Beginners – SQL Exam Prep Series 70-433 – Volume 1</a></strong>.</div>
<div>
<p><strong>[<a href="http://amzn.to/j2p-1" target="_blank">Amazon</a>] | [<a href="http://bit.ly/pinalbook1" target="_blank">Flipkart</a>] | [<a href="http://amzn.to/sqlbook1onkindle" target="_blank">Kindle</a>] | [<a href="http://bit.ly/ip-j2p-1" target="_blank">IndiaPlaza</a>]</strong></p>
</div>
<p style="text-align:justify;">This is follow up blog post of my earlier blog post on the same subject - <strong><a href="http://blog.sqlauthority.com/2012/04/23/sql-server-introduction-to-sql-server-security-a-primer/" target="_blank">SQL SERVER – Introduction to SQL Server Security – A Primer</a></strong>. In the article we discussed various basics terminology of the security. The article further covers following important concepts of security.</p>
<ul style="text-align:justify;">
<li>Granting Permissions</li>
<li>Denying Permissions</li>
<li>Revoking Permissions</li>
</ul>
<p style="text-align:justify;">Above three are the most important concepts related to security and SQL Server.  There are many more things one has to learn but without beginners fundamentals one can&#8217;t learn the advanced  concepts. Let us have small quiz and check how many of you get the fundamentals right.</p>
<h3 style="text-align:justify;">Quiz</h3>
<p style="text-align:justify;"><strong>1) If you granted Phil control to the server, but denied his ability to create databases, what would his effective permissions be?</strong></p>
<ol style="text-align:justify;">
<li>Phil can do everything.</li>
<li>Phil can do nothing.</li>
<li>Phil can do everything except create databases.</li>
</ol>
<p style="text-align:justify;"><strong>2) If you granted Phil control to the server and revoked his ability to create databases, what would his effective permissions be?</strong></p>
<ol style="text-align:justify;">
<li>Phil can do everything.</li>
<li>Phil can do nothing.</li>
<li>Phil can do everything except create databases.</li>
</ol>
<p style="text-align:justify;"><strong>3) You have a login named James who has Control Server permission. You want to elimintate his ability to create databases without affecting any other permissions. What SQL statement would you use?</strong></p>
<ol style="text-align:justify;">
<li>ALTER LOGIN James DISABLE</li>
<li>DROP LOGIN James</li>
<li>DENY CREATE DATABASE To James</li>
<li>REVOKE CREATE DATABASE To James</li>
<li>GRANT CREATE DATABASE To James</li>
</ol>
<div style="text-align:justify;">
<p>Now make sure that you write down all the answers on the piece of paper.</p>
<p>Watch following video and read earlier article over here. If you want to change the answer you still have chance.</p>
<span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/07/sql-server-quiz-and-video-introduction-to-sql-server-security/"><img src="http://img.youtube.com/vi/NnaTqgyJGyU/2.jpg" alt="" /></a></span>
<h3>Solution</h3>
<p>1) 3</p>
<p>2) 1</p>
<p>3) 3</p>
<p>Now compare let us check the answers and compare your answers to following answers. I am very confident you will get them correct.</p>
</div>
<h3 style="text-align:justify;"><a href="http://blog.sqlauthority.com/sql-server-books/sql-joes-2-pros-five-book-combo-list-of-best-sql-server-books/"><img class="alignleft" src="http://www.pinaldave.com/bimg/j2pimages/combos.png" alt="" width="250" height="160" /></a></h3>
<div style="text-align:justify;">
<p><strong>Available at</strong></p>
<p><strong>USA: <a href="http://amzn.to/sqlfiveamazon" target="_blank">Amazon</a></strong></p>
<p><strong>India: <a href="http://bit.ly/sqlfiveflipkart" target="_blank">Flipkart </a>| <a href="http://bit.ly/ip-fivebooks" target="_blank">IndiaPlaza</a></strong></p>
<p><strong>Volume: <a href="http://bit.ly/sa-book1" target="_blank">1</a>, <a href="http://bit.ly/sa-book2" target="_blank">2</a>, <a href="http://bit.ly/sa-book3" target="_blank">3</a>, <a href="http://bit.ly/sa-book4" target="_blank">4</a>, <a href="http://bit.ly/sa-book5" target="_blank">5</a></strong></p>
<p>Please leave your feedback in the comment area for the quiz and video. Did you know all the answers of the quiz?</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 />Filed under: <a href='http://blog.sqlauthority.com/category/joes-2-pros/'>Joes 2 Pros</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/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/18518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18518/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18518/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18518/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18518&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/TpNbCNba02YdkjFcd2uBE8r_dK4/0/da"><img src="http://feedads.g.doubleclick.net/~a/TpNbCNba02YdkjFcd2uBE8r_dK4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TpNbCNba02YdkjFcd2uBE8r_dK4/1/da"><img src="http://feedads.g.doubleclick.net/~a/TpNbCNba02YdkjFcd2uBE8r_dK4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7VIEPo05xUE:ds_t7Z_Pqz0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7VIEPo05xUE:ds_t7Z_Pqz0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7VIEPo05xUE:ds_t7Z_Pqz0:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=7VIEPo05xUE:ds_t7Z_Pqz0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=7VIEPo05xUE:ds_t7Z_Pqz0:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/7VIEPo05xUE" height="1" width="1"/>]]></content:encoded><description>This blog post is inspired from Beginning SQL Joes 2 Pros: The SQL Hands-On Guide for Beginners – SQL Exam Prep Series 70-433 – Volume 1. [Amazon] &amp;#124; [Flipkart] &amp;#124; [Kindle] &amp;#124; [IndiaPlaza] This is follow up blog post of my earlier blog post on the same subject - SQL SERVER – Introduction to SQL Server Security – [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18518&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/07/sql-server-quiz-and-video-introduction-to-sql-server-security/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/j2pimages/combos.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/07/sql-server-quiz-and-video-introduction-to-sql-server-security/</feedburner:origLink></item><item><title>SQL SERVER – Four Tutorial for SQL Server 2012 New Features</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/6vzkyAOk6Rs/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>SQL Training</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Sat, 05 May 2012 18:30:19 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18515</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">One of the very common question I receive on my <strong><a href="http://fb.com/SQLAuth" target="_blank">facebook</a> </strong>is that if there is any tutorial for SQL Server 2012 new enhanced features and solutions. I see this demand a bit increasing as the SQL Server 2012 is more and more being adopted. Here is the list of four tutorial which is specifically created for SQL Server 2012 by Microsoft.</p>
<p style="text-align:justify;"><a href="http://msdn.microsoft.com/en-us/library/ms170208.aspx" target="_blank">Multidimensional Modeling (Adventure Works Tutorial)<br />
</a>This tutorial teaches you how to develop and deploy an Analysis Services project that enables the employees of Adventure Works Cycles to analyze various aspects of their business.</p>
<p style="text-align:justify;"><a href="http://msdn.microsoft.com/en-us/library/hh231691.aspx" target="_blank">Tabular Modeling (Adventure Works Tutorial)<br />
</a>This tutorial teaches you how to create a SQL Server 2012 Analysis Services tabular model that enable sales and marketing teams to easily analyze internet sales data in the AdventureWorksDW2012 data warehouse. You will build the tabular model in SQL Server Data Tools.</p>
<p style="text-align:justify;"><a href="http://go.microsoft.com/fwlink/?LinkId=221204" target="_blank">Tutorials and Demos for Power View<br />
</a>Create Power View reports and explore Power View features. View demos, videos, and tutorials that help you get started quickly with Power View and successfully build reports with interactive filters and visualizations such as bubble charts, tiles, and cards.</p>
<p style="text-align:justify;"><a href="http://msdn.microsoft.com/en-us/library/bb677213.aspx" target="_blank">Tutorial: Using the hierarchyid Data Type<br />
</a>This tutorial is intended for users who are experienced with Transact-SQL, but are new to the <strong>hierarchyid</strong> data type. In this tutorial, you convert an existing table to a hierarchical structure, and you also create a new table to store and manage hierarchical data efficiently.</p>
<p style="text-align:justify;">Note: The description of the course is taken from original course description. You will need to install <strong><a href="http://www.youtube.com/watch?v=-NRSvfKlh84" target="_blank">SQL Server 2012 AdventureWorks</a></strong> for all this tutorial.</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 />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/sqlauthority/sql-training/'>SQL Training</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/18515/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18515/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18515/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18515/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18515/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18515/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18515/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18515/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18515/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18515/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18515/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18515/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18515/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18515/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18515&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/GwVt428sP8BLC1zOd01eSn0oTtk/0/da"><img src="http://feedads.g.doubleclick.net/~a/GwVt428sP8BLC1zOd01eSn0oTtk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GwVt428sP8BLC1zOd01eSn0oTtk/1/da"><img src="http://feedads.g.doubleclick.net/~a/GwVt428sP8BLC1zOd01eSn0oTtk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=6vzkyAOk6Rs:Dsw1m2VrENA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=6vzkyAOk6Rs:Dsw1m2VrENA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=6vzkyAOk6Rs:Dsw1m2VrENA:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=6vzkyAOk6Rs:Dsw1m2VrENA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=6vzkyAOk6Rs:Dsw1m2VrENA:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/6vzkyAOk6Rs" height="1" width="1"/>]]></content:encoded><description>One of the very common question I receive on my facebook is that if there is any tutorial for SQL Server 2012 new enhanced features and solutions. I see this demand a bit increasing as the SQL Server 2012 is more and more being adopted. Here is the list of four tutorial which is specifically created for [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18515&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/06/sql-server-four-tutorial-for-sql-server-2012-new-features/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><feedburner:origLink>http://blog.sqlauthority.com/2012/05/06/sql-server-four-tutorial-for-sql-server-2012-new-features/</feedburner:origLink></item><item><title>SQL SERVER – Migrate a SQL Server Reports from one server to another server</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/G13JSdFJwaA/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>SQL Utility</category><category>T SQL</category><category>Technology</category><category>SQL Reporting</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Fri, 04 May 2012 18:30:38 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18502</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">How many time you have felt that there should be need of the tool which help you to migrate SQL Server Reports from one server to another server. Well, I am glad to see this migration tool for migrating reports from SQL Server 2008 R2 and later version. This tool uses powershell for migration  script. Here is the requirement of source server and target server. Source server must be native mode using Windows authentication. Target server must be SharePoint integrated mode. The web application must be using Windows classic authentication mode.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/reportmigration.png" alt="" width="567" height="577" /></p>
<p style="text-align:justify;">You can migrate it using any of the following methods.</p>
<ol style="text-align:justify;">
<li>Command-line tool (RSMigrationTool.exe)</li>
<li>GUI tool (RSMigrationUI.exe)</li>
</ol>
<p style="text-align:justify;">Either of the tool will generate a powershell script which will migrate the reports. This tool also generates the log file which provides the additional details regarding the migration.</p>
<p style="text-align:justify;">Here is the link to <a href="http://www.microsoft.com/en-us/download/details.aspx?id=29560" target="_blank">Download the SQL Server Reporting Migration Too</a>l.</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 />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/sql-utility/'>SQL Utility</a>, <a href='http://blog.sqlauthority.com/category/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a> Tagged: <a href='http://blog.sqlauthority.com/tag/sql-reporting/'>SQL Reporting</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/18502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18502/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18502&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/DoxPyDjU4pnLXiKlY2XVmjGYXjA/0/da"><img src="http://feedads.g.doubleclick.net/~a/DoxPyDjU4pnLXiKlY2XVmjGYXjA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DoxPyDjU4pnLXiKlY2XVmjGYXjA/1/da"><img src="http://feedads.g.doubleclick.net/~a/DoxPyDjU4pnLXiKlY2XVmjGYXjA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=G13JSdFJwaA:L8yPfqXKATI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=G13JSdFJwaA:L8yPfqXKATI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=G13JSdFJwaA:L8yPfqXKATI:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=G13JSdFJwaA:L8yPfqXKATI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=G13JSdFJwaA:L8yPfqXKATI:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/G13JSdFJwaA" height="1" width="1"/>]]></content:encoded><description>How many time you have felt that there should be need of the tool which help you to migrate SQL Server Reports from one server to another server. Well, I am glad to see this migration tool for migrating reports from SQL Server 2008 R2 and later version. This tool uses powershell for migration  script. [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18502&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/05/sql-server-migrate-a-sql-server-reports-from-one-server-to-another-server/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/reportmigration.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/05/sql-server-migrate-a-sql-server-reports-from-one-server-to-another-server/</feedburner:origLink></item><item><title>SQL SERVER – Identify Columnstore Index Usage from Execution Plan</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/udhaZR-CCug/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Index</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Thu, 03 May 2012 18:30:20 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18492</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I think there was a time when lots of questions were coming via either email or blog comments. Nowadays, the trend seems to change. Most of the question I receive is through social media. Here is the latest question I received through Twitter. The best or worst part of Twitter is that it allows only 140 characters, so I’ve noticed that a question is easy to ask on Twitter, but an answer is difficult to provide using this social network.</p>
<p>The question I received at <a href="http://twitter.com/pinaldave" target="_blank"><strong>http://twitter.com/pinaldave</strong></a> is as follows:</p>
<p>&#8220;<strong><em>How do I know if columnstore index is used by query through execution plan?</em></strong>&#8220;</p>
<p>Well, my reaction was simple &#8211; &#8220;<strong><em>From Operators</em></strong>&#8220;. See, I managed to answer this in two words only. However, I was not satisfied with my own answer. The questioner did not follow up after this question but I personally did not like my answer. I felt that if he was talking about execution plan, he is indeed aware of operators. If he was aware of operators, my answer was no use to him. Suddenly, I thought I was arrogant (or at least not clear). I sent him a direct message that I would write a blog post tomorrow to explain how to figure out if columnstore index is used or not via execution plan.</p>
<p>If you are interested in Columnstore Index, read following related posts on my blog  for additional details:</p>
<ul>
<li><a href="http://blog.sqlauthority.com/2011/10/29/sql-server-fundamentals-of-columnstore-index/"><strong>SQL SERVER – Fundamentals of Columnstore Index</strong></a></li>
<li><a href="http://blog.sqlauthority.com/2011/10/30/sql-server-how-to-ignore-columnstore-index-usage-in-query/"><strong>SQL SERVER – How to Ignore Columnstore Index Usage in Query</strong></a></li>
<li><a href="http://blog.sqlauthority.com/2011/11/06/sql-server-updating-data-in-a-columnstore-index/"><strong>SQL SERVER – Updating Data in A Columnstore Index</strong></a></li>
<li><a href="http://blog.sqlauthority.com/2011/11/07/sql-server-video-performance-improvement-in-columnstore-index/"><strong>SQL SERVER – Video – Performance Improvement in Columnstore Index</strong></a></li>
</ul>
<p>To demonstrate this scenario, I have created the following script. I am using AdventureWorks (note: <a href="http://www.youtube.com/watch?v=-NRSvfKlh84" target="_blank"><strong>AdventureWorks Installation 60 Seconds Tutorial</strong></a>) for this sample database. Here are the steps which are to be followed:</p>
<ul>
<li>Create a sample table</li>
<li>Insert some data</li>
<li>Create clustered index on it</li>
<li>Create nonclustered Columnstore Index on it</li>
<li>Enable execution plan in SSMS</li>
<li>Run two SELECT statement together with using clustered indexand columnstore index (use hint if needed)</li>
</ul>
<p>Let us create environment and populate tables.</p>
<p><code style="font-size:12px;"><span style="color:blue;">CREATE DATABASE </span><span style="color:black;">CLAdventureWorks<br />
GO<br />
</span><span style="color:blue;">USE </span><span style="color:black;">CLAdventureWorks<br />
GO<br />
</span><span style="color:green;">-- Create New Table<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:black;">[dbo].[MySalesOrderDetail]</span><span style="color:gray;">(<br />
</span><span style="color:black;">[SalesOrderID] [int] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[SalesOrderDetailID] [int] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[CarrierTrackingNumber] [nvarchar]</span><span style="color:gray;">(</span><span style="color:black;">25</span><span style="color:gray;">) NULL,<br />
</span><span style="color:black;">[OrderQty] [smallint] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[ProductID] [int] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[SpecialOfferID] [int] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[UnitPrice] [money] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[UnitPriceDiscount] [money] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[LineTotal] [numeric]</span><span style="color:gray;">(</span><span style="color:black;">38</span><span style="color:gray;">, </span><span style="color:black;">6</span><span style="color:gray;">) NOT NULL,<br />
</span><span style="color:black;">[rowguid] [uniqueidentifier] </span><span style="color:gray;">NOT NULL,<br />
</span><span style="color:black;">[ModifiedDate] [datetime] </span><span style="color:gray;">NOT NULL<br />
) </span><span style="color:blue;">ON </span><span style="color:black;">[PRIMARY]<br />
GO<br />
</span><span style="color:green;">-- Create clustered index<br />
</span><span style="color:blue;">CREATE CLUSTERED INDEX </span><span style="color:black;">[CL_MySalesOrderDetail] </span><span style="color:blue;">ON </span><span style="color:black;">[dbo].[MySalesOrderDetail]<br />
</span><span style="color:gray;">( </span><span style="color:black;">[SalesOrderDetailID]</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:green;">-- Create Sample Data Table<br />
-- WARNING: This Query may run upto 2-10 minutes based on your systems resources<br />
</span><span style="color:blue;">INSERT INTO </span><span style="color:black;">[dbo].[MySalesOrderDetail]<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">S1.</span><span style="color:gray;">*<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">AdventureWorks.Sales.SalesOrderDetail S1<br />
GO 10<br />
</span><span style="color:green;">-- Create ColumnStore Index<br />
</span><span style="color:blue;">CREATE NONCLUSTERED </span><span style="color:black;">COLUMNSTORE </span><span style="color:blue;">INDEX </span><span style="color:black;">[IX_MySalesOrderDetail_ColumnStore]<br />
</span><span style="color:blue;">ON </span><span style="color:black;">[MySalesOrderDetail]<br />
</span><span style="color:gray;">(</span><span style="color:black;">UnitPrice</span><span style="color:gray;">, </span><span style="color:black;">OrderQty</span><span style="color:gray;">, </span><span style="color:black;">ProductID</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Now <strong><a href="http://blog.sqlauthority.com/2007/08/28/sql-server-actual-execution-plan-vs-estimated-execution-plan/" target="_blank">enable the actual execution plan in SSMS</a></strong>.</p>
<p style="text-align:justify;">Run following two SELECT statement together.</p>
<p><code style="font-size:12px;"><span style="color:green;">-- Select Table with Clustered Index (Not Columnstore)<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">ProductID</span><span style="color:gray;">, </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">UnitPrice</span><span style="color:gray;">) </span><span style="color:black;">SumUnitPrice</span><span style="color:gray;">, </span><span style="color:magenta;">AVG</span><span style="color:gray;">(</span><span style="color:black;">UnitPrice</span><span style="color:gray;">) </span><span style="color:black;">AvgUnitPrice</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">OrderQty</span><span style="color:gray;">) </span><span style="color:black;">SumOrderQty</span><span style="color:gray;">, </span><span style="color:magenta;">AVG</span><span style="color:gray;">(</span><span style="color:black;">OrderQty</span><span style="color:gray;">) </span><span style="color:black;">AvgOrderQty<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">[dbo].[MySalesOrderDetail] </span><span style="color:blue;">WITH</span><span style="color:gray;">(</span><span style="color:blue;">INDEX</span><span style="color:gray;">(</span><span style="color:black;">[CL_MySalesOrderDetail]</span><span style="color:gray;">))<br />
</span><span style="color:blue;">GROUP BY </span><span style="color:black;">ProductID<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">ProductID<br />
GO<br />
</span><span style="color:green;">-- Select Table with Columnstore Index<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">ProductID</span><span style="color:gray;">, </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">UnitPrice</span><span style="color:gray;">) </span><span style="color:black;">SumUnitPrice</span><span style="color:gray;">, </span><span style="color:magenta;">AVG</span><span style="color:gray;">(</span><span style="color:black;">UnitPrice</span><span style="color:gray;">) </span><span style="color:black;">AvgUnitPrice</span><span style="color:gray;">,<br />
</span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">OrderQty</span><span style="color:gray;">) </span><span style="color:black;">SumOrderQty</span><span style="color:gray;">, </span><span style="color:magenta;">AVG</span><span style="color:gray;">(</span><span style="color:black;">OrderQty</span><span style="color:gray;">) </span><span style="color:black;">AvgOrderQty<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">[dbo].[MySalesOrderDetail]<br />
</span><span style="color:blue;">GROUP BY </span><span style="color:black;">ProductID<br />
</span><span style="color:blue;">ORDER BY </span><span style="color:black;">ProductID<br />
GO</span></code></p>
<p style="text-align:justify;">Both will return the same result set. Click on Execution Plan Window.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/regularcolumn.jpg" alt="" width="338" height="402" /></p>
<p>You will see that there is different execution plan operator for regular clustered index and non-clustered columnstore index.</p>
<p>When you hover your mouse on both operators, they open operator tip which also clearly indicates if it is a regular clustered index and non-clustered columnstore index.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/regularcolumn1.png" alt="" width="344" height="605" /></p>
<p>In case of the columnstore index, you will notice that the execution mode is also Batch instead of Row execution mode.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/regularcolumn2.png" alt="" width="370" height="631" /></p>
<p>I guess now this completes the answer for the question asked to me on Twitter. Let us quickly clean up.</p>
<p><code style="font-size:12px;"><span style="color:green;">-- Cleanup<br />
</span><span style="color:blue;">DROP INDEX </span><span style="color:black;">[IX_MySalesOrderDetail_ColumnStore] </span><span style="color:blue;">ON </span><span style="color:black;">[dbo].[MySalesOrderDetail]<br />
GO<br />
</span><span style="color:blue;">TRUNCATE TABLE </span><span style="color:black;">dbo.MySalesOrderDetail<br />
GO<br />
</span><span style="color:blue;">DROP TABLE </span><span style="color:black;">dbo.MySalesOrderDetail<br />
GO</span></code></p>
<p>Feel free to ask me any question on social media &#8211; <strong><a href="http://twitter.com/pinaldave" target="_blank">twitter</a> </strong>or <strong><a href="http://facebook.com/SQLAuth" target="_blank">facebook</a></strong>.</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>
<div></div>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-index/'>SQL Index</a>, <a href='http://blog.sqlauthority.com/category/technology/sql-query/'>SQL Query</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/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/18492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18492&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/DjAn4p6FibHG7zTdRu5VJihW35w/0/da"><img src="http://feedads.g.doubleclick.net/~a/DjAn4p6FibHG7zTdRu5VJihW35w/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DjAn4p6FibHG7zTdRu5VJihW35w/1/da"><img src="http://feedads.g.doubleclick.net/~a/DjAn4p6FibHG7zTdRu5VJihW35w/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=udhaZR-CCug:8wX53-4QepI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=udhaZR-CCug:8wX53-4QepI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=udhaZR-CCug:8wX53-4QepI:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=udhaZR-CCug:8wX53-4QepI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=udhaZR-CCug:8wX53-4QepI:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/udhaZR-CCug" height="1" width="1"/>]]></content:encoded><description>I think there was a time when lots of questions were coming via either email or blog comments. Nowadays, the trend seems to change. Most of the question I receive is through social media. Here is the latest question I received through Twitter. The best or worst part of Twitter is that it allows only [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18492&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/04/sql-server-identify-columnstore-index-usage-from-execution-plan/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/regularcolumn.jpg" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/regularcolumn1.png" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/regularcolumn2.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/04/sql-server-identify-columnstore-index-usage-from-execution-plan/</feedburner:origLink></item><item><title>SQL SERVER – A Tricky Question and Even Trickier Answer – Index Intersection – Partition Function</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/ddIp-MQQNcI/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Index</category><category>SQL Puzzle</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Wed, 02 May 2012 18:30:43 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18476</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">During yesterday’s evening, I asked a very simple question on my <a href="http://www.facebook.com/SQLAuth/posts/299968496748617" target="_blank"><strong>Facebook Page</strong></a>. The question was written in a jiffy and in a very light mood. While writing the question, I left a few things out, and the question did miss a few details about setup. However, as the question was not complete, it created an extremely interesting conversation in the following thread.</p>
<p style="text-align:justify;">Here is the question: <strong><em>Write a select statement using a single table, using single table single time only without using join keywords, which generate execution plan with 2 join operators. Use AdventureWorks as a sample database.</em></strong></p>
<p style="text-align:justify;">I got many interesting answers to the question I posted. I must say that I learned something new from all these answers. Before I discuss my own answer, let me show the answer provided by <a href="http://www.facebook.com/SQLAuth/posts/299968496748617?comment_id=1984472&amp;offset=0&amp;total_comments=26" target="_blank">Alphonso Jones</a>.</p>
<p style="text-align:justify;">Here is his answer:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:black;">Row_number</span><span style="color:gray;">() </span><span style="color:blue;">OVER </span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">) </span><span style="color:black;">num</span><span style="color:gray;">, </span><span style="color:black;">Rank</span><span style="color:gray;">() </span><span style="color:blue;">OVER </span><span style="color:gray;">(</span><span style="color:blue;">ORDER BY </span><span style="color:magenta;">OBJECT_ID </span><span style="color:blue;">DESC</span><span style="color:gray;">) </span><span style="color:black;">num2<br />
</span><span style="color:blue;">INTO </span><span style="color:#434343;">#tmp<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">sys.columns<br />
</span><span style="color:green;">-- Enable Execution Plan with CTRL+M<br />
</span><span style="color:blue;">SELECT </span><span style="color:black;">num</span><span style="color:gray;">, </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span><span style="color:black;">num2</span><span style="color:gray;">) </span><span style="color:blue;">OVER </span><span style="color:gray;">(</span><span style="color:black;">Partition </span><span style="color:blue;">BY </span><span style="color:black;">num</span><span style="color:gray;">)<br />
</span><span style="color:blue;">FROM </span><span style="color:#434343;">#tmp</span></code></p>
<p style="text-align:justify;">When I saw this answer &#8211; I was very happy because I did not visualize it as a solution when I was asking the question. Here is the execution plan of the T-SQL code above. It’s easy to see that there are multiple joins because of the Partition Function used in the query. What an excellent participation by <a href="http://www.facebook.com/SQLAuth/posts/299968496748617?comment_id=1984472&amp;offset=0&amp;total_comments=26" target="_blank">Alphonso Jones</a>.</p>
<div class="wp-caption alignnone" style="width: 510px"><img src="http://www.pinaldave.com/bimg/exjoin1.png" alt="" width="500" /><p class="wp-caption-text">Click to Enlarge</p></div>
<p style="text-align:justify;">Here is the answer which I had visualized when I asked the question. I was running the query on AdventureWorks database and executed the following query, which in turn, generated an execution plan with multiple joins:</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">USE </span><span style="color:black;">AdventureWorks2012<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;">[Purchasing].[PurchaseOrderHeader]<br />
</span><span style="color:blue;">WHERE </span><span style="color:black;">[EmployeeID] </span><span style="color:blue;">= </span><span style="color:black;">258 </span><span style="color:gray;">AND </span><span style="color:black;">[VendorID] </span><span style="color:blue;">= </span><span style="color:black;">1580<br />
GO</span></code></p>
<p style="text-align:justify;">Look at the execution plan of the above query. You can see the joins even though I am using single table and there is no join syntax in the query.</p>
<div class="wp-caption alignnone" style="width: 510px"><img class=" " src="http://www.pinaldave.com/bimg/exjoin2.png" alt="" width="500" /><p class="wp-caption-text">Click to Enlarge</p></div>
<p style="text-align:justify;">Personally, I liked the solution of Alphonso Jones as his solution will always generate multiple joins due to Partition Function. On the other hand, my solution is a bit tricky for it requires Indexes on the table [Purchasing].[PurchaseOrderHeader], which generates index intersection. Index Intersection is a technique which utilizes more than one index on a table to satisfy a given query.</p>
<p style="text-align:justify;">Thanks <a href="http://www.facebook.com/SQLAuth/posts/299968496748617?comment_id=1984472&amp;offset=0&amp;total_comments=26" target="_blank">Alphonso Jones</a>.</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>
<div></div>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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-index/'>SQL Index</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/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/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/18476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18476&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/tlgjFwVv9GQkCw2MQucAqi57Wlg/0/da"><img src="http://feedads.g.doubleclick.net/~a/tlgjFwVv9GQkCw2MQucAqi57Wlg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/tlgjFwVv9GQkCw2MQucAqi57Wlg/1/da"><img src="http://feedads.g.doubleclick.net/~a/tlgjFwVv9GQkCw2MQucAqi57Wlg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=ddIp-MQQNcI:eTOlQB7lieE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=ddIp-MQQNcI:eTOlQB7lieE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=ddIp-MQQNcI:eTOlQB7lieE:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=ddIp-MQQNcI:eTOlQB7lieE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=ddIp-MQQNcI:eTOlQB7lieE:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/ddIp-MQQNcI" height="1" width="1"/>]]></content:encoded><description>During yesterday’s evening, I asked a very simple question on my Facebook Page. The question was written in a jiffy and in a very light mood. While writing the question, I left a few things out, and the question did miss a few details about setup. However, as the question was not complete, it created an [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18476&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/03/sql-server-a-tricky-question-and-even-trickier-answer-index-intersection-partition-function/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/exjoin1.png" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/exjoin2.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/03/sql-server-a-tricky-question-and-even-trickier-answer-index-intersection-partition-function/</feedburner:origLink></item><item><title>SQL SERVER – Video – Step by Step Installation of SQL Server 2012</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/NRHlkzO1qa8/</link><category>Database</category><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Tue, 01 May 2012 18:30:46 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18381</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;">SQL Server 2012 launched on March 7, 2012.</p>
<p style="text-align:justify;">SQL Server 2012 was available on April 1, 2012 for General Availability.</p>
<p style="text-align:justify;"><img class="alignnone" src="http://www.pinaldave.com/bimg/ss2012logo.png" alt="" width="500" /></p>
<p style="text-align:justify;">Recently I have received quite a few queries that they are facing issues with SQL Server 2012 installation. I have tried to solve quite a few problems and I figured out really there is no big problem but most of the problem are faced by people who are attempting to install it first time and have no previous experience about installing SQL Server. I decided to create a quick video with voice instruction regarding how to install SQL Server 2012. It is 3 minute long video and if you are installing SQL Server 2012, you can play this video on another machine and follow the steps.</p>
<p style="text-align:justify;"><span style="text-align:center; display: block;"><a href="http://blog.sqlauthority.com/2012/05/02/sql-server-video-step-by-step-installation-of-sql-server-2012/"><img src="http://img.youtube.com/vi/2vQ_wrwUvK8/2.jpg" alt="" /></a></span></p>
<p style="text-align:justify;">I have attempted default installation of the SQL Server. However, there are few additional option one can consider as well &#8211; collation, default installation folder, and few other server related configurations.</p>
<p style="text-align:justify;">Here are few resources related to SQL Server 2012 I have blogged earlier.</p>
<ul style="text-align:justify;">
<li><strong><a href="http://blog.sqlauthority.com/2012/03/11/sql-server-2012-all-download-links-in-single-page-sql-server-2012/">SQL SERVER – 2012 – All Download Links in Single Page – SQL Server 2012</a></strong></li>
<li><strong><a href="http://blog.sqlauthority.com/2012/03/10/sqlauthority-news-sql-server-2012-microsoft-learning-training-and-certification/">SQLAuthority News – SQL Server 2012 – Microsoft Learning Training and Certification</a></strong></li>
<li><strong><a href="http://blog.sqlauthority.com/2012/03/09/sqlauthority-news-download-microsoft-sql-server-2012-rtm-now/">SQLAuthority News – Download Microsoft SQL Server 2012 RTM Now</a></strong></li>
<li><strong><a title="Permanent Link to SQL SERVER – Installing AdventureWorks Sample Database – SQL in Sixty Seconds #010 – Video" href="http://blog.sqlauthority.com/2012/04/11/sql-server-installing-adventureworks-sample-database-sql-in-sixty-seconds-010-video/" rel="bookmark">Installing AdventureWorks Sample Database – SQL in Sixty Seconds #010 – Video</a></strong></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></p>
<br />Filed under: <a href='http://blog.sqlauthority.com/category/database/'>Database</a>, <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/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/18381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18381/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18381/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18381/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18381&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/DojJv0oaLb1O4wwSYNAzUj1zFLI/0/da"><img src="http://feedads.g.doubleclick.net/~a/DojJv0oaLb1O4wwSYNAzUj1zFLI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/DojJv0oaLb1O4wwSYNAzUj1zFLI/1/da"><img src="http://feedads.g.doubleclick.net/~a/DojJv0oaLb1O4wwSYNAzUj1zFLI/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=NRHlkzO1qa8:VWXnq0ojf_A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=NRHlkzO1qa8:VWXnq0ojf_A:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=NRHlkzO1qa8:VWXnq0ojf_A:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=NRHlkzO1qa8:VWXnq0ojf_A:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=NRHlkzO1qa8:VWXnq0ojf_A:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/NRHlkzO1qa8" height="1" width="1"/>]]></content:encoded><description>SQL Server 2012 launched on March 7, 2012. SQL Server 2012 was available on April 1, 2012 for General Availability. Recently I have received quite a few queries that they are facing issues with SQL Server 2012 installation. I have tried to solve quite a few problems and I figured out really there is no [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18381&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/02/sql-server-video-step-by-step-installation-of-sql-server-2012/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/ss2012logo.png" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/02/sql-server-video-step-by-step-installation-of-sql-server-2012/</feedburner:origLink></item><item><title>SQL SERVER – Maximum Allowable Length of Characters for Temp Objects is 116 – Guest Post by Balmukund Lakhani</title><link>http://feedproxy.google.com/~r/SQLAuthority/~3/gGL09BPMC84/</link><category>PostADay</category><category>SQL</category><category>SQL Authority</category><category>SQL Query</category><category>SQL Server</category><category>SQL Tips and Tricks</category><category>T SQL</category><category>Technology</category><category>Temp Table</category><category>TempDB</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">pinaldave</dc:creator><pubDate>Mon, 30 Apr 2012 18:30:26 PDT</pubDate><guid isPermaLink="false">http://blog.sqlauthority.com/?p=18272</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p style="text-align:justify;"><strong><img class="alignleft" src="http://www.pinaldave.com/bimg/Balmukund.JPG" alt="" width="200" height="300" />Balmukund Lakhani</strong> (<a href="http://blogs.msdn.com/SQLServerFAQ" target="_blank">Blog</a> | <a href="http://twitter.com/blakhani" target="_blank">Twitter</a> | <a href="http://sqlserver-help.com" target="_blank">Site</a>) is currently working as Technical Lead in SQL Support team with Microsoft India GTSC. In past 7+ years with Microsoft he was also a part of Premier Field Engineering Team for 18 month. During that time he was a part of rapid onsite support (ROSS) team. Prior to joining Microsoft in 2005, he worked as SQL developer, SQL DBA and also got chance to wear his other hat as an ERP Consultant.</p>
<p style="text-align:justify;"><strong>Here is the guest post by <a href="http://blogs.msdn.com/SQLServerFAQ" target="_blank">Balmukund Lakhani</a></strong></p>
<p style="text-align:justify;">Recently Dhananjay (<a href="http://dhananjayspeaks.wordpress.com/" target="_blank">B</a> | <a href="http://www.twitter.com/dhananjayjgd" target="_blank">T</a>) posted an interesting question on the <a href="https://www.facebook.com/groups/213527572040350/" target="_blank">SQLServerFAQ community page</a> since the answer was new to almost all in the group, I have taken idea to write a blog post to explain this in detail. Here we go.</p>
<p style="text-align:justify;"><strong><em>Question:<br />
All objects can have minimum 1 and maximum of 128 characters in their names in SQL Server. Only exception is local temporary tables that can have maximum of 116 characters. What&#8217;s the technical reason behind this? Anyone, why that&#8217;s so?</em></strong></p>
<p style="text-align:justify;">Manas (<a href="http://manasdash.wordpress.com/" target="_blank">B</a> | <a href="http://www.twitter.com/simplymanas" target="_blank">T</a>) posted this <a href="http://msdn.microsoft.com/en-us/library/ms175874.aspx" target="_blank">link</a> from books online which tells this limitation but I always wanted to explore what happens under the hood.  Here is the simple repro of problem statement</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">DECLARE </span><span style="color:#434343;">@i </span><span style="color:blue;">NVARCHAR</span><span style="color:gray;">(</span><span style="color:black;">800</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:#434343;">@i </span><span style="color:blue;">= </span><span style="color:magenta;">REPLICATE</span><span style="color:gray;">(</span><span style="color:red;">'A'</span><span style="color:gray;">, </span><span style="color:black;">116</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:#434343;">@i </span><span style="color:blue;">= </span><span style="color:red;">'CREATE TABLE #'</span><span style="color:gray;">+</span><span style="color:#434343;">@i</span><span style="color:gray;">+</span><span style="color:red;">'(i int)'<br />
</span><span style="color:blue;">PRINT </span><span style="color:#434343;">@i<br />
</span><span style="color:blue;">EXEC</span><span style="color:gray;">(</span><span style="color:#434343;">@i</span><span style="color:gray;">)</span></code></p>
<p style="text-align:justify;">In above script I am trying to create a temp table (starts with #) and you would see below output.</p>
<p style="text-align:left;">CREATE TABLE #AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA(i int)</p>
<p style="text-align:left;"><span style="color:#ff0000;">Msg 193, Level 15, State 1, Line 1</span><br />
<span style="color:#ff0000;">The object or column name starting with &#8216;#AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&#8217; is too long. The maximum length is 116 characters.</span></p>
<p style="text-align:justify;">The URL which was pointed by Manas (<a href="http://manasdash.wordpress.com/" target="_blank">B</a> | <a href="http://www.twitter.com/simplymanas" target="_blank">T</a>) clearly explained this<br />
{<br />
<em>Both regular and delimited identifiers must contain from 1 through 128 characters. For local temporary tables, the identifier can have a maximum of 116 characters.</em><br />
}</p>
<p style="text-align:justify;">If you try to create a normal table with more than 128 characters then you would see</p>
<p style="text-align:left;"><span style="color:#ff0000;">Msg 103, Level 15, State 4, Line 1</span><br />
<span style="color:#ff0000;">The identifier that starts with &#8216;#AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&#8217; is too long. Maximum length is 128.</span></p>
<p style="text-align:justify;">If you read the message closely, there are two error numbers 193 and 103 which have different length.  Now the real question is why there is differentiation between regular table and temp table Let’s create two temp tables now. I am giving name as A and A [repeated 128 times]</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">DECLARE </span><span style="color:#434343;">@i </span><span style="color:blue;">NVARCHAR</span><span style="color:gray;">(</span><span style="color:black;">800</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:#434343;">@i </span><span style="color:blue;">= </span><span style="color:magenta;">REPLICATE</span><span style="color:gray;">(</span><span style="color:red;">'A'</span><span style="color:gray;">, </span><span style="color:black;">115</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:#434343;">@i </span><span style="color:blue;">= </span><span style="color:red;">'CREATE TABLE #'</span><span style="color:gray;">+</span><span style="color:#434343;">@i</span><span style="color:gray;">+</span><span style="color:red;">'(i int)'<br />
</span><span style="color:blue;">PRINT </span><span style="color:#434343;">@i<br />
</span><span style="color:blue;">EXEC</span><span style="color:gray;">(</span><span style="color:#434343;">@i</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO<br />
</span><span style="color:blue;">DECLARE </span><span style="color:#434343;">@i </span><span style="color:blue;">NVARCHAR</span><span style="color:gray;">(</span><span style="color:black;">800</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:#434343;">@i </span><span style="color:blue;">= </span><span style="color:magenta;">REPLICATE</span><span style="color:gray;">(</span><span style="color:red;">'B'</span><span style="color:gray;">, </span><span style="color:black;">1</span><span style="color:gray;">)<br />
</span><span style="color:blue;">SELECT </span><span style="color:#434343;">@i </span><span style="color:blue;">= </span><span style="color:red;">'CREATE TABLE #'</span><span style="color:gray;">+</span><span style="color:#434343;">@i</span><span style="color:gray;">+</span><span style="color:red;">'(i int)'<br />
</span><span style="color:blue;">PRINT </span><span style="color:#434343;">@i<br />
</span><span style="color:blue;">EXEC</span><span style="color:gray;">(</span><span style="color:#434343;">@i</span><span style="color:gray;">)<br />
</span><span style="color:black;">GO</span></code></p>
<p style="text-align:justify;">Here is the output which you would see. Now execute the same output in the SSMS.</p>
<p><code style="font-size:12px;"><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</span><span style="color:gray;">(</span><span style="color:black;">i </span><span style="color:blue;">INT</span><span style="color:gray;">)<br />
</span><span style="color:blue;">CREATE TABLE </span><span style="color:#434343;">#B</span><span style="color:gray;">(</span><span style="color:black;">i </span><span style="color:blue;">INT</span><span style="color:gray;">)</span></code></p>
<p style="text-align:justify;">If you run above piece of code in SSMS, you would see object getting created. Now, let’s find out the name of the object in tempdb database</p>
<p style="text-align:justify;"><code style="font-size:12px;"><span style="color:blue;">SELECT </span><span style="color:magenta;">LEN</span><span style="color:gray;">(</span><span style="color:black;">name</span><span style="color:gray;">) </span><span style="color:red;">'Length'</span><span style="color:gray;">, </span><span style="color:black;">name<br />
</span><span style="color:blue;">FROM </span><span style="color:black;">tempdb.sys.objects<br />
</span><span style="color:blue;">WHERE TYPE = </span><span style="color:red;">'u'<br />
</span><span style="color:gray;">AND </span><span style="color:black;">name </span><span style="color:gray;">LIKE </span><span style="color:red;">'#AAAAAA%'<br />
</span><span style="color:gray;">OR </span><span style="color:black;">name </span><span style="color:gray;">LIKE </span><span style="color:red;">'#B%'</span></code></p>
<p style="text-align:justify;">Here is the output.</p>
<div class="wp-caption alignnone" style="width: 510px"><a href="http://www.pinaldave.com/bimg/tempobject-116.jpg"><img src="http://www.pinaldave.com/bimg/tempobject-116.jpg" alt="" width="500" height="30" /></a><p class="wp-caption-text">Click to expand</p></div>
<p style="text-align:justify;">Length of both the object name is 128 even if we create object with length name as 116 and 1. That should give you little clue about the behavior.</p>
<p style="text-align:justify;"><em><strong>Summary:</strong></em><br />
Whatever object name you give for temp table, SQL is going to pad the value with underscores and few “magic” bit as the end and would cover complete 128 characters. Have a closer look at length of magic bit “000000000058” and “000000000059” in above output [yeah, its 12]. Those are needed because you are allowed to create same name temp table by different sessions.  The length of magical number is 12 so 128 &#8211; 12 = 116 is the max length which is allowed for temp objects as SQL adds 12 chars at the end.</p>
<p style="text-align:justify;">In case you are in Facebook, you may want to check the group <a href="https://www.facebook.com/groups/213527572040350/" target="_blank">SQLServerFAQ</a> for other interesting questions.</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 />Filed under: <a href='http://blog.sqlauthority.com/category/technology/postaday/'>PostADay</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/technology/sql-query/'>SQL Query</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/technology/t-sql/'>T SQL</a>, <a href='http://blog.sqlauthority.com/category/technology/'>Technology</a> Tagged: <a href='http://blog.sqlauthority.com/tag/temp-table/'>Temp Table</a>, <a href='http://blog.sqlauthority.com/tag/tempdb/'>TempDB</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sqlauthority.wordpress.com/18272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sqlauthority.wordpress.com/18272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sqlauthority.wordpress.com/18272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sqlauthority.wordpress.com/18272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sqlauthority.wordpress.com/18272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sqlauthority.wordpress.com/18272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sqlauthority.wordpress.com/18272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sqlauthority.wordpress.com/18272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sqlauthority.wordpress.com/18272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sqlauthority.wordpress.com/18272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sqlauthority.wordpress.com/18272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sqlauthority.wordpress.com/18272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sqlauthority.wordpress.com/18272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sqlauthority.wordpress.com/18272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&#038;blog=668536&#038;post=18272&#038;subd=sqlauthority&#038;ref=&#038;feed=1" width="1" height="1" />
<p><a href="http://feedads.g.doubleclick.net/~a/HZQlMUTwCktYbGoQN24zV1zAel8/0/da"><img src="http://feedads.g.doubleclick.net/~a/HZQlMUTwCktYbGoQN24zV1zAel8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HZQlMUTwCktYbGoQN24zV1zAel8/1/da"><img src="http://feedads.g.doubleclick.net/~a/HZQlMUTwCktYbGoQN24zV1zAel8/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gGL09BPMC84:4Al6ogzVV7E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gGL09BPMC84:4Al6ogzVV7E:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gGL09BPMC84:4Al6ogzVV7E:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SQLAuthority?a=gGL09BPMC84:4Al6ogzVV7E:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/SQLAuthority?i=gGL09BPMC84:4Al6ogzVV7E:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SQLAuthority/~4/gGL09BPMC84" height="1" width="1"/>]]></content:encoded><description>Balmukund Lakhani (Blog &amp;#124; Twitter &amp;#124; Site) is currently working as Technical Lead in SQL Support team with Microsoft India GTSC. In past 7+ years with Microsoft he was also a part of Premier Field Engineering Team for 18 month. During that time he was a part of rapid onsite support (ROSS) team. Prior to joining [...]&lt;img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.sqlauthority.com&amp;#038;blog=668536&amp;#038;post=18272&amp;#038;subd=sqlauthority&amp;#038;ref=&amp;#038;feed=1" width="1" height="1" /&gt;</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blog.sqlauthority.com/2012/05/01/sql-server-maximum-allowable-length-of-characters-for-temp-objects-is-116-guest-post-by-balmukund-lakhani/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">8</slash:comments><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://0.gravatar.com/avatar/48aa5a2264e8a27d802bb22ab6ccf688?s=96&amp;d=identicon" medium="image">
			<media:title type="html">pinaldave</media:title>
		</media:content><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/Balmukund.JPG" medium="image" /><media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://www.pinaldave.com/bimg/tempobject-116.jpg" medium="image" /><feedburner:origLink>http://blog.sqlauthority.com/2012/05/01/sql-server-maximum-allowable-length-of-characters-for-temp-objects-is-116-guest-post-by-balmukund-lakhani/</feedburner:origLink></item></channel></rss>

