<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL Fool &#187; tools</title>
	<atom:link href="http://sqlfool.com/tag/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlfool.com</link>
	<description>Adventures in SQL Tuning - a blog for the rest of us</description>
	<lastBuildDate>Wed, 02 Nov 2011 20:39:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SQL Tweaks and Tools That Make My Life Easier</title>
		<link>http://sqlfool.com/2008/12/sql-tweaks-and-tools-that-make-my-life-easier/</link>
		<comments>http://sqlfool.com/2008/12/sql-tweaks-and-tools-that-make-my-life-easier/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 14:27:27 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
				<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[SQL Tips]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[indexes]]></category>
		<category><![CDATA[SSMS]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=226</guid>
		<description><![CDATA[It still surprises me how many people don't know about some of the very things that make my job so much easier. So this next post is dedicated to sharing some of the tweaks and tools I've run across that will help anyone who works with SQL: &#160; Indexes Anyone who uses included columns is [...]]]></description>
			<content:encoded><![CDATA[<p>It still surprises me how many people don't know about some of the very things that make my job so much easier.  So this next post is dedicated to sharing some of the tweaks and tools I've run across that will help anyone who works with SQL:</p>
<p>&nbsp;</p>
<p><span style="color: #ff6600;"><strong>Indexes</strong></span><br />
Anyone who uses included columns is probably well aware of the frustrations that can come from having to look up information on which columns are included.  I wrote a stored procedure, <a href="http://sqlfool.com/2008/10/index-interrogation-script/" target="_blank">dba_indexLookup_sp</a>, to help me with this, before discovering sp_helpindex2.  If you haven't heard of sp_helpindex2, it's a re-write of sp_helpindex by Kimberly Tripp.  You can find it on <a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Updates-(fixes)-to-sp_helpindex2.aspx" target="_blank">Kimberly's blog</a>.  The main difference is Kimberly's is a system stored procedure (mine is not) and my version returns partitioning information (Kimberly's does not).  Check both out and use whichever one meets your needs best.  </p>
<p>&nbsp;</p>
<p><span style="color: #ff6600;"><strong>KeyBoard ShortCuts</strong></span></p>
<p>In SQL Server Management Studio (SSMS), click on:<br />
&nbsp;&nbsp;&nbsp;&nbsp;Tools --> Options... --> Environment --> Keyboard</p>
<div class="wp-caption alignnone" style="width: 654px"><a href="http://sqlfool.com/blogImages/20081203/tweaks_1.jpg"><img alt="Keyboard Shortcuts" src="http://sqlfool.com/blogImages/20081203/tweaks_1_small.jpg" title="Keyboard Shortcuts" /></a><p class="wp-caption-text">Keyboard Shortcuts</p></div>
<p>For your copying convenience:</p>
<p>Ctrl+3&nbsp;&nbsp;&nbsp;Select Top 100 * From<br />
Ctrl+4&nbsp;&nbsp;&nbsp;sp_tables @table_owner = 'dbo'<br />
Ctrl+5&nbsp;&nbsp;&nbsp;sp_columns<br />
Ctrl+6&nbsp;&nbsp;&nbsp;sp_stored_procedures @sp_owner = 'dbo'<br />
Ctrl+7&nbsp;&nbsp;&nbsp;sp_spaceused<br />
Ctrl+8&nbsp;&nbsp;&nbsp;sp_helptext<br />
Ctrl+9&nbsp;&nbsp;&nbsp;<a href="http://sqlfool.com/2008/10/index-interrogation-script/" target="_blank">dba_indexLookup_sp</a> or <a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Updates-(fixes)-to-sp_helpindex2.aspx" target="_blank">sp_helpindex2</a></p>
<p>Please note that these settings will not take effect until you open a new query window.  Here's an example of how you could use this:  use Ctrl+4 to find a list of tables, then copy one into your query window; to view a sample of that table's data, highlight the table name (I usually double-click on it) and press Ctrl+3.  It's a thing of beauty.  Oh, and you may want to remove/change the schema filters if you use schemas other than dbo.</p>
<p>&nbsp;</p>
<p><span style="color: #ff6600;"><strong>Query Execution Settings</strong></span></p>
<p>After having one too many issues arise from non-DBA's connecting to the production environment to run a devastating ad hoc, I've had all of our developers and analysts adopt the following settings.  The only thing difference between my setting and theirs is that I have "Set Statistics IO" selected.  FYI - you can also make these same setting changes in Visual Studio.</p>
<p>In SQL Server Management Studio (SSMS), click on:<br />
&nbsp;&nbsp;&nbsp;&nbsp;Tools --> Options... --> Query Execution --> SQL Server --> Advanced</p>
<div class="wp-caption alignnone" style="width: 654px"><a href="http://sqlfool.com/blogImages/20081203/tweaks_2.jpg"><img alt="Query Execution Settings" src="http://sqlfool.com/blogImages/20081203/tweaks_2_small.jpg" title="Query Execution Settings"/></a><p class="wp-caption-text">Query Execution Settings</p></div>
<p>&nbsp;</p>
<p><span style="color: #ff6600;"><strong>Copy Behavior</strong></span><br />
This next tip actually has nothing to do with SQL Server, and can be done with any Microsoft product.  However, I just learned about it a few weeks ago and already I use it quite frequently.  </p>
<p>Holding down "Alt" while you drag your mouse will change your selection behavior to block selection.</p>
<div class="wp-caption alignnone" style="width: 826px"><a href="http://sqlfool.com/blogImages/20081203/tweaks_5.jpg"><img alt="Block Selection" src="http://sqlfool.com/blogImages/20081203/tweaks_5_small.jpg" title="Block Selection"/></a><p class="wp-caption-text">Block Selection</p></div>
<p>&nbsp;</p>
<p><strong>Please note:</strong> The following tools requires SQL 2008 Management Studio.  These tools will also work when you connect SQL 2008 SSMS to a 2005 instance.</p>
<p>&nbsp;</p>
<p><span style="color: #ff6600;"><strong>Object Detail Explorer</strong></span></p>
<p>Finally, there's a reason to use the Object Detail Explorer!  My favorite use is to quickly find the table size and row counts of all the tables in a database.  If these options are not currently available, you may just need to right click on the column headers and add it to the display.</p>
<div class="wp-caption alignnone" style="width: 839px"><a href="http://sqlfool.com/blogImages/20081203/tweaks_3.jpg"><img alt="Object Detail Explorer" src="http://sqlfool.com/blogImages/20081203/tweaks_3_small.jpg" title="Object Detail Explorer"/></a><p class="wp-caption-text">Object Detail Explorer</p></div>
<p>&nbsp;</p>
<p><span style="color: #ff6600;"><strong>Missing Indexes</strong></span></p>
<p>And lastly, when using SSMS 2008 to execute Display Estimated Query Plan (Ctrl+L), it will show you if you're missing any indexes.  This will even work if you connect SSMS 2008 to SQL 2005!</p>
<div class="wp-caption alignnone" style="width: 806px"><a href="http://sqlfool.com/blogImages/20081203/tweaks_4.jpg"><img alt="Missing Index" src="http://sqlfool.com/blogImages/20081203/tweaks_4_small.jpg" title="Missing Index"/></a><p class="wp-caption-text">Missing Index</p></div>
<p>That pretty much covers it for now.  HTH!  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Michelle</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2008/12/sql-tweaks-and-tools-that-make-my-life-easier/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

