<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www2.sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Kalen Delaney : Tools</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx</link><description>Tags: Tools</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Did You Know? Troubleshooting Tools Update</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2009/01/23/troubleshooting-tools-update.aspx</link><pubDate>Fri, 23 Jan 2009 17:44:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:11399</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>0</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/11399.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=11399</wfw:commentRss><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last May,&amp;nbsp; I blogged about &lt;A href="http://sqlblog.com/blogs/kalen_delaney/archive/2008/05/17/free-troubleshooting-tools.aspx" target=_blank&gt;free troubleshooting tools&lt;/A&gt; for SQL Server and today I received a comment that one of the tools listed seemed to no longer be available.&amp;nbsp; So I thought I would publish a refresh. &lt;/P&gt;
&lt;P&gt;There are dozens of great tools available, and I'm not even pretending that I am going to list them all. This post is really just an update to the tools I listed previously.&amp;nbsp; So here is the list from my May post, with additional comments.&lt;/P&gt;
&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;RML Utilities for SQL Server&lt;/FONT&gt;&lt;/STRONG&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://support.microsoft.com/kb/944837"&gt;http://support.microsoft.com/kb/944837&lt;/A&gt; 
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&amp;amp;displaylang=en&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;RML Utilities are still around and better than ever. You can read about the CU1 here: 
&lt;P&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/psssql/archive/2008/11/12/cumulative-update-1-to-the-rml-utilities-for-microsoft-sql-server-released.aspx"&gt;http://blogs.msdn.com/psssql/archive/2008/11/12/cumulative-update-1-to-the-rml-utilities-for-microsoft-sql-server-released.aspx&lt;/A&gt; 
&lt;P&gt;And some comments from the SQLCAT team here: 
&lt;P&gt;&lt;A href="http://sqlcat.com/technicalnotes/archive/2008/02/01/precision-performance-for-microsoft-sql-server-using-rml-utilities-9-0.aspx"&gt;http://sqlcat.com/technicalnotes/archive/2008/02/01/precision-performance-for-microsoft-sql-server-using-rml-utilities-9-0.aspx&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;SQL Nexus&lt;/FONT&gt;&lt;/STRONG&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://www.sqlnexus.net/"&gt;&lt;STRIKE&gt;http://www.sqlnexus.net/&lt;/STRIKE&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The SQL Nexus tools have moved to codeplex: 
&lt;P&gt;&lt;A href="http://www.codeplex.com/sqlnexus"&gt;http://www.codeplex.com/sqlnexus&lt;/A&gt; 
&lt;P&gt;And if you want more free tools than the ones listed here, check out everything else available at Codeplex! 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;PSSDIAG Data Collection Utility&lt;/FONT&gt;&lt;/STRONG&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5564386A-28C2-4483-8293-76FFF67B9EB3&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=5564386A-28C2-4483-8293-76FFF67B9EB3&amp;amp;displaylang=en&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(This one is still here.) 
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;SQL Server Performance Analysis Utilities Read80Trace and OSTRESS&lt;/FONT&gt;&lt;/STRONG&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://support.microsoft.com/kb/887057"&gt;http://support.microsoft.com/kb/887057&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Although the KB article is still available, the links it points to are broken. 
&lt;P&gt;OSTRESS and Read%Trace are are incorporated into RML tools, so see the first link above! 
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;STRONG&gt;S&lt;/STRONG&gt;&lt;STRONG&gt;QL Server Health and History Tool (SQLH2)&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=EEDD10D6-75F7-4763-86DE-D2347B8B5F89&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=EEDD10D6-75F7-4763-86DE-D2347B8B5F89&amp;amp;displaylang=en&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The KB articles is still there, but you can also get the Health and History Tool from Codeplex: 
&lt;P&gt;&lt;A href="http://www.codeplex.com/sqlh2"&gt;http://www.codeplex.com/sqlh2&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;Performance Dashboard&lt;/FONT&gt;&lt;/STRONG&gt; 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=1d3a4a0d-7e0c-4730-8204-e419218c1efc&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=1d3a4a0d-7e0c-4730-8204-e419218c1efc&amp;amp;displaylang=en&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(This one is still here.) 
&lt;P&gt;I started out that post by mentioning: 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I'm very excited about the new &lt;FONT size=2&gt;Management Data Warehouse&lt;/FONT&gt; coming in SQL Server 2008 (which was called Performance Studio at one point), but keep in mind there are lots of available tools in the current versions.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And now that I've had a chance to use the MDW a bit, I've even more excited. I think THIS is the reason to upgrade to SQL 2008 (if you haven't found another reason yet.) 
&lt;P&gt;Have fun! 
&lt;P&gt;&lt;FONT color=#ff00ff size=4&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=11399" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/SQLTrace/default.aspx">SQLTrace</category></item><item><title>Geek City: Reading the Transaction Log</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2008/08/23/reading-the-transaction-log.aspx</link><pubDate>Sat, 23 Aug 2008 21:07:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:8506</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>46</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/8506.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=8506</wfw:commentRss><description>&lt;P&gt;Sorry, I'm not actually going to tell you how to read the log. I'm just going to talk about it... and whether it's a good thing to be able to do or not, or whether it's an absolutely crucial feature that MS needs to provide for us immediately, in a hotfix, if not sooner. Forget about fixing bugs, I want to read the log because I forgot to set up a trace beforehand....&lt;/P&gt;
&lt;P&gt;You may have noticed that my blogging frequency has fallen off. One or two of you also noticed that I am no longer writing a regular article each month for &lt;EM&gt;SQL Server Magazine&lt;/EM&gt;. Those two facts are related. I have cut back on non-essential activities to try to get my next book out as soon as possible.&amp;nbsp; It looks like I might even finish in time to get the book out on the shelves by early next year. Stay tuned... &lt;/P&gt;
&lt;P&gt;Since I couldn't bear to not do anything for &lt;EM&gt;SQL Server Magazine&lt;/EM&gt;, I started writing the commentary in the weekly email newsletter.&amp;nbsp; Actually, I do it every week but the fourth week of the month. If you like, you can sign up for this free newsletter &lt;A href="http://www.sqlmag.com/email/" target=_blank&gt;here&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;My commentary last Thursday seemed to have rattled some cages. Before I even woke up Thursday morning, there were already two comments on the site, and someone sent me a personal email about what I wrote.&amp;nbsp; By now, there are quite a few more comments. I basically wrote about the need for a log reader tool. It wasn't deeply technical; it's just a commentary after all. You can read it &lt;A href="http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076" target=_blank&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A title=http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076 href="http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076"&gt;http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But boy, did people get upset. They called me bad names... well, if 'mediocre' can be considered a bad name...&lt;/P&gt;
&lt;P&gt;So I responded as follows:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Wow... I have never gotten so many comments so quickly about one of my articles. I must really have touched a nerve here!&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT color=#0000ff&gt;There is a difference between the actual data rows referenced by the log, and the log format. It's the log format, and giving people full details about what is in the log, that is propriatary information. There is nothing specifically bad about giving people that information. However, calling me names because I don't stand up on a soapbox and DEMAND that MS add this functionality seems a little extreme. There are plenty of other things MS could do with the product and providing a log reader tool is way down on the list. &lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Yes I realize it is important to some people, but there are many other ways to get this information through tracing etc. If the developer resources are limited at MS, I would much prefer they spend their time on more important stuff. MS knows it's important that people have this information, that's why they added a great deal of additional tracing capabilities in SQL Server 2008.&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT color=#0000ff&gt;Also, keep in mind that a log reader tool wouldn't help you debug problems with logic, or with bad reports due to faulty SELECTs. If your WHERE clause was written badly, a log reader tool could tell you which rows were affected, but not WHY. You'd need a tracing tool for that. Vogelm's comment that a log reader tool would help troubleshoot bad queries from 3rd party apps is not true; you need to see the statements for that, not just the affected data.&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT color=#0000ff&gt;I do appreciate kbreneman's comment that the real problem is one of perception. MS should make clear that the transaction log is not an audit tool; if you want auditing, you need to set it up on your own, because you're the only one who knows what's important for you to capture.&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(The only way to respond to comments is to write a comment of my own, and then the form insists that I rate the article I am responding to. I always feel a bit weird having to rate my own articles.) 
&lt;P&gt;Since I wrote the article, I have found out that Lumigent does have a log reader tool for SQL Server 2005, but I have heard less than stellar reviews about its ability to capture some of the more interesting datatype activities that are now possible in SQL Server 2005. And their website still doesn't list any version numbers. 
&lt;P&gt;I can't stop thinking about this, so I thought I would open up the issue to a wider audience. 
&lt;P&gt;How important do you think it is that Microsoft provide a log reader tool for us? 
&lt;P&gt;Thanks! 
&lt;P&gt;&lt;FONT color=#ff00ff size=4&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=8506" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/SQL+Server+Magazine/default.aspx">SQL Server Magazine</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/transaction+log/default.aspx">transaction log</category></item><item><title>Did You Know? Free SQL Server Troubleshooting Tools</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2008/05/17/free-troubleshooting-tools.aspx</link><pubDate>Sun, 18 May 2008 03:47:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6845</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>6</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/6845.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=6845</wfw:commentRss><description>&lt;P&gt;I'm very excited about the new Management Data Warehouse coming in SQL Server 2008 (which was called Performance Studio at one point), but keep in mind there are lots of available tools in the current versions. &lt;/P&gt;
&lt;P&gt;One of the students in my class last week put together this list of his favorites. Note that some of the tools can be used together. For example, the PSSDIAG collection utility output can be pumped into SQL Nexus for nice reporting and analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;RML Utilities for SQL Server&lt;/STRONG&gt; 
&lt;P&gt;&lt;A href="http://support.microsoft.com/kb/944837"&gt;&lt;FONT size=1&gt;http://support.microsoft.com/kb/944837&lt;/FONT&gt;&lt;/A&gt; 
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&amp;amp;displaylang=en"&gt;&lt;FONT size=1&gt;http://www.microsoft.com/downloads/details.aspx?familyid=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;SQL Nexus&lt;/STRONG&gt; 
&lt;P&gt;&lt;A href="http://www.sqlnexus.net/"&gt;&lt;FONT size=1&gt;http://www.sqlnexus.net/&lt;/FONT&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;PSSDIAG Data Collection Utility&lt;/STRONG&gt; 
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5564386A-28C2-4483-8293-76FFF67B9EB3&amp;amp;displaylang=en"&gt;&lt;FONT size=1&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=5564386A-28C2-4483-8293-76FFF67B9EB3&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt; 
&lt;P align=left&gt;&lt;STRONG&gt;Description of the SQL Server Performance Analysis Utilities Read80Trace and OSTRESS&lt;/STRONG&gt; 
&lt;P align=left&gt;&lt;A href="http://support.microsoft.com/kb/887057"&gt;&lt;FONT size=1&gt;http://support.microsoft.com/kb/887057&lt;/FONT&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;SQL Server Health and History Tool (SQLH2)&lt;/STRONG&gt; 
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=EEDD10D6-75F7-4763-86DE-D2347B8B5F89&amp;amp;displaylang=en"&gt;&lt;FONT size=1&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=EEDD10D6-75F7-4763-86DE-D2347B8B5F89&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;Performance Dashboard&lt;/STRONG&gt; 
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=1d3a4a0d-7e0c-4730-8204-e419218c1efc&amp;amp;displaylang=en"&gt;&lt;FONT size=1&gt;http://www.microsoft.com/downloads/details.aspx?familyid=1d3a4a0d-7e0c-4730-8204-e419218c1efc&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff size=4&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=6845" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Management+Tools/default.aspx">Management Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Performance/default.aspx">Performance</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category></item><item><title>Geek City: Included Columns</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/12/31/included-columns.aspx</link><pubDate>Mon, 31 Dec 2007 19:53:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:4295</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>3</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/4295.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=4295</wfw:commentRss><description>&lt;P&gt;When an issue comes up more than once in a short period of time, I figure it is a message from the Universe. I might even assume it is a gift of blog fodder. So I won't turn down the gift, even if it means another juicy post before the end of year, much to Denis' disappointment. &lt;/P&gt;
&lt;P&gt;The issue is SQL Server 2005 "Included Columns". There was a post on the public newsgroups about them a couple of days ago, and just yesterday, there was a similar post on the SQL Server MVP private newsgroup.&amp;nbsp; Simply put, the questions were expressing concern that there were no built-in tools in SQL Server 2005 to list which columns were included columns. The information is of course available in the metadata views, but it can require a join of at least three of them to get a simple list of which columns are "included columns" in a given index.&amp;nbsp; The poster on the MVP newsgroup wanted to know if someone had already written such a query and could share it, to save him some work. &lt;/P&gt;
&lt;P&gt;There actually was a third post about included columns that I came across,&amp;nbsp; that was asking about the reasons for using included columns. I will address that question first, and then provide some scripts to return information about included columns.&lt;/P&gt;
&lt;P&gt;You need to be aware of two 'features' of indexes to fully appreciate included columns. &lt;/P&gt;
&lt;P&gt;First: all indexes have a limit of no more than 16 key columns, with a combined total of no more than 900 bytes.&lt;/P&gt;
&lt;P&gt;Second: a 'covering' index, which is a nonclustered index that contains all the columns referenced in a query from one table, can provide an incredible performance advantage. If all the information a query needs is contained in the index keys, SQL Server will never need to actually access the table data, and not having to do this table lookup can be a very good thing. (Disclaimer: covering indexes are not the solution to ALL query performance problems, and I don't have time today to provide a full discussion of covering indexes.) &lt;/P&gt;
&lt;P&gt;SQL Server 2005 allows you to get around the 16 column and 900 byte limit and add additional column to a nonclustered index to provide greater opportunity for covering indexes. The syntax would look something like this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;CREATE INDEX bigindex on mybigrowtable(keycolumn) INCLUDE (bigcolumn1, bigcolumn2)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If all the columns you would like to have in your index fit within the limits, there is no technical reason for having included columns; all your columns could just be regular key columns. However, there are some other issues to consider. &lt;/P&gt;
&lt;P&gt;1) Space requirements: Normal key columns, as part of the key, are propagated up through all levels of your indexes. So if you have some very large columns, even if they fit in the 900 byte limit, you can save space by defining them as included columns.&amp;nbsp; Here is an example, using the AdventureWorks database:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;USE AdventureWorks &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;-- set the database to bulk_logged recovery &lt;BR&gt;--&amp;nbsp; prior to copying tables &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;ALTER DATABASE AdventureWorks &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET RECOVERY bulk_logged&lt;BR&gt;GO&lt;BR&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;---------------------&lt;BR&gt;IF ( OBJECT_ID('Person.Address1') is not null)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP TABLE Person.Address1&lt;BR&gt;GO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;IF ( OBJECT_ID('Person.Address2') is not null)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP TABLE Person.Address2 &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;-------------------------------------- &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;-- Create two copies of the Person.Address table and enlarge one of the columns &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;SELECT * INTO Person.Address1 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM Person.Address&lt;BR&gt;GO&lt;BR&gt;ALTER TABLE Person.Address1 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALTER COLUMN AddressLine2 nchar(350)&lt;BR&gt;GO &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;-- Create an index with two included columns &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;CREATE INDEX IX_Address_City &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on [Person].[Address1] (City, StateProvinceID)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INCLUDE(AddressLine1, AddressLine2)&lt;BR&gt;GO&lt;BR&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;------------------- &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;SELECT * INTO Person.Address2 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM Person.Address&lt;BR&gt;GO&lt;BR&gt;ALTER TABLE Person.Address2 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALTER COLUMN AddressLine2 nchar(350)&lt;BR&gt;GO&lt;BR&gt;-- Create a 'regular' index with no included columns;&lt;BR&gt;-- All four columns are keys, and included at all index levels&lt;BR&gt;CREATE INDEX IX_Address_City &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on [Person].[Address2] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (City, StateProvinceID, AddressLine1, AddressLine2)&lt;BR&gt;GO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;-- Note that the Address2 index uses about 1.5 MB &lt;BR&gt;-- more than&amp;nbsp; the index on Address1, because it contains&lt;BR&gt;-- all 4 keys in all levels of the index. &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;EXEC sp_spaceused 'Person.Address1'&lt;BR&gt;EXEC sp_spaceused 'Person.Address2'&lt;BR&gt;GO&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;2) Maintenance costs: Normal key columns are maintained in sorted order. An index on (lastname, state, city) would have 3 sort columns and every new row would have to be put in the proper location based on all 3 columns. But an index on lastname, with (state, city) as included columns, would not have to maintain sort order on state and city and that could improve the performance of data modification operations. I haven't done any tests yet to determine how much savings you might realize, but it will be faster with included columns. &lt;/P&gt;
&lt;P&gt;The downside of included columns not being sorted, is that those columns will not be useful for searching if those columns are in the WHERE clause, in particular if those columns are using in an inequality expression. &lt;/P&gt;
&lt;P&gt;So now, how can you retrieve information about which columns are included and which are key columns?&amp;nbsp; Sp_helpindex does not display this information, in fact, it makes no mention of included columns. The information is available in a catalog view called sys.index_columns, in a column called 'is_included_column'. The code below creates a view that you can use to return information about all the columns in your indexes.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000a0&gt;&lt;STRONG&gt;CREATE VIEW index_column_info&lt;BR&gt;AS&lt;BR&gt;&amp;nbsp; SELECT object_name = object_name(ic.object_id),&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index_name = i.name,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'column' = c.name,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'column usage' = CASE ic.is_included_column&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN 0 then 'KEY'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE 'INCLUDED'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END&lt;BR&gt;&amp;nbsp;&amp;nbsp; FROM sys.index_columns ic JOIN sys.columns c&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON ic.object_id = c.object_id&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND ic.column_id = c.column_id&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JOIN sys.indexes i&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON i.object_id = ic.object_id&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND i.index_id = ic.index_id&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can select from this view and supply a table name and/or an index name or id in a WHERE clause: 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;SELECT * FROM index_column_info&lt;BR&gt;WHERE object_name = 'Address1'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A student in one of my classes earlier this year wanted a way to get input back that looked like the sp_helpindex output. I am attaching a script to build a stored procedure called new_helpindex which will do that. However, the new procedure is used a bit differently than sp_helpindex. sp_helpindex requires a schema name and new_helpindex does not. So to get information about my new Address1 table created above, the two procedures would be called as shown:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000a0 size=2&gt;&lt;STRONG&gt;EXEC new_helpindex 'address1'&lt;BR&gt;EXEC sp_helpindex 'person.address1'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want the new_helpindex procedure to accept schema names, and to return exactly the same details as sp_helpindex (plus the included columns), it is certainly possible, and I leave that as an exercise to my readers. 
&lt;P&gt;Have fun! 
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=4295" width="1" height="1"&gt;</description><enclosure url="http://www2.sqlblog.com/blogs/kalen_delaney/attachment/4295.ashx" length="2955" type="text/plain" /><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/included+columns/default.aspx">included columns</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/indexes/default.aspx">indexes</category></item><item><title>Geek City: Christmas Present from PSS</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/12/18/geek-city-christmas-present-from-pss.aspx</link><pubDate>Tue, 18 Dec 2007 21:12:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:4075</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>3</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/4075.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=4075</wfw:commentRss><description>&lt;P&gt;I rarely just make a post that is a link to someone else's blog post, but this one is too good to allow anyone to miss. So if you haven't seen any other announcements about this one, you'll see it here.&lt;/P&gt;
&lt;P&gt;Two of the incredible guys in Product Support Services for SQL Server at Microsoft have released a set of tools that could change your life!&lt;/P&gt;
&lt;P&gt;Check out the RML Utilities here:&lt;/P&gt;
&lt;P&gt;&lt;A title=http://blogs.msdn.com/psssql/archive/2007/12/18/rml-utilities-for-microsoft-sql-server-released.aspx href="http://blogs.msdn.com/psssql/archive/2007/12/18/rml-utilities-for-microsoft-sql-server-released.aspx"&gt;http://blogs.msdn.com/psssql/archive/2007/12/18/rml-utilities-for-microsoft-sql-server-released.aspx&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(RML stands for Replay Markup Language which is the XML used by these tools &lt;BR&gt;to determine how to replay a set of SQLTrace files.)&lt;/P&gt;
&lt;P&gt;Thanks Keith and Bob!&lt;/P&gt;
&lt;P&gt;Have fun, everyone!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=4075" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Performance/default.aspx">Performance</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/SQLTrace/default.aspx">SQLTrace</category></item><item><title>Did you know? Cloning is Legal (and Available in SQL Server 2005)</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/11/21/cloning-in-sql-server-2005.aspx</link><pubDate>Wed, 21 Nov 2007 18:50:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3465</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>5</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/3465.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=3465</wfw:commentRss><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I first heard about the possibility of database cloning way back in version 7.0 and thought it sounded like a great idea. Who wouldn't love to have a bunch of identical little databases running around, of smaller size and easier manageability? &lt;/P&gt;
&lt;P&gt;Cloning a database means creating a statistics only copy of it, so that you can examine execution plans for poorly performing queries&amp;nbsp;in a test environment that takes hardly any space at all.&amp;nbsp; A clone database has all the metadata for all your objects, including function and stored procedure definitions. It has all the statistics for all the objects including the histograms and density information returned by DBCC SHOW_STATISTICS. Looking at space usage information shows you only the pages used, but not the pages allocated but unused. &lt;/P&gt;
&lt;P&gt;So how can you get a little clone of your own? The original plan was to have a toolbar option to just click and presto, there would be your clone. That never happened. Later, one of the optimizer engineers at Microsoft created a stored procedure, called something like sp_clone_db that took a database name as a parameter, and created a new database with all the metadata and statistics, but none of the data, of the original. That procedure was never&amp;nbsp;included with any version of the product.&lt;/P&gt;
&lt;P&gt;Instead, what we have in SQL Server 2005 is the ability to script a database, and include the statistics and histogram information.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In SQL Server Management Studio's Object Explorer, right-click your database name and choose Tasks, and then Generate Scripts....&lt;/P&gt;
&lt;P&gt;Choose the name of the database to script, and select the box to "Script all objects in the selected database".&amp;nbsp; Next you'll see a "Choose Script Options" dialog with several dozen options to choose from, mostly indicating whether your want to include certain properties or objects in your database. Most of these you can leave at the default, or deselect the ones you're not interested in. I usually select the option to create the database, so it will include the CREATE DATABASE statement and any necessary filegroups. If you don't do this, and your database has objects created on filegroups other than the primary, your script will need a lot more manual editing. &lt;/P&gt;
&lt;P&gt;There are two&amp;nbsp;options that you &lt;STRONG&gt;must&lt;/STRONG&gt; change in this "Choose Script Options" dialog. In the General section&amp;nbsp;is the one called "Script Statistics". When you click in the list of options on the right side, you'll see three different options. The default is "Do not script statistics". &lt;FONT color=#ff0000&gt;Choose the option to "Script statistics and histograms."&lt;/FONT&gt; When you make this selection, you'll get a warning like the following:&lt;/P&gt;&lt;A href="http://sqlblog.com/blogs/kalen_delaney/WindowsLiveWriter/87e4c1029f59_B0F8/image05.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH:0px;BORDER-LEFT-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-RIGHT-WIDTH:0px;" height=116 src="http://sqlblog.com/blogs/kalen_delaney/WindowsLiveWriter/87e4c1029f59_B0F8/image0_thumb3.png" width=545 border=0&gt;&lt;/A&gt; 
&lt;P&gt;If you want a clone, you'll have to use this option, so don't let this warning scare you.&lt;/P&gt;
&lt;P&gt;In the Table/View Options section (you'll have to scroll down) &lt;FONT color=#ff0000&gt;change "Script Indexes" to True.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Click Ok, and after you click Next to&amp;nbsp;leave this "Choose Script Options" dialog, the&amp;nbsp;"Output Options" dialog opens. &amp;nbsp; (If you forget to check the box for scripting all objects in the database in the very&amp;nbsp;first dialog, you'll get about 10 different dialogs asking you to choose which objects you want to copy, before you get to the "Output Options" dialog. Don't say I didn't warn you.)&lt;/P&gt;
&lt;P&gt;I usually just choose to copy to a New&amp;nbsp;Query Window and click Next. I then get a chance to confirm my choices, and then I click Finish. The copy process begins.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;WARNING: If you notice in the confirmation list that you forgot something, or want to go back and make any changes, the option to Script Indexes will be set back to false. You'll need to make sure to reset it to True before going forward again.&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P&gt;Once I get the script in the new window, I need to make sure I change all references to the original database name to a new name. (If you are creating the clone on a different server that doesn't have the original database, then you won't have to do this step.) Make sure you check the filenames and make sure they don't duplicate existing names.&amp;nbsp; Execute when ready.&lt;/P&gt;
&lt;P&gt;Or, you might want to spend a few minutes examining the script. You'll see UPDATE STATISTICS statements like you've never seen before, looking something like the following. (My clone was created on the AdventureWorks database):&lt;/P&gt;
&lt;P&gt;UPDATE STATISTICS [Sales].[CreditCard]([AK_CreditCard_CardNumber]) WITH STATS_STREAM = 0x0100000002000144 &amp;lt;huge big long hex value&amp;gt; 000000000000510D0000000000,&amp;nbsp; ROWCOUNT = 19118, PAGECOUNT = 93&lt;/P&gt;
&lt;P&gt;So the UPDATE STATISTICS statements force a particular histogram into the statistics, as well as the page count and row count.&lt;/P&gt;
&lt;P&gt;Once you've created the new database, you should be able run queries to look at sizing information. &lt;/P&gt;
&lt;P&gt;EXEC sp_spaceused 'Sales.SalesOrderDetail' &lt;/P&gt;
&lt;P&gt;returns the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; rows&amp;nbsp;&amp;nbsp;&amp;nbsp;reserved data&amp;nbsp;&amp;nbsp;&amp;nbsp; index_size unused&lt;BR&gt;---------------- ------ -------- ------- ---------- ------&lt;BR&gt;SalesOrderDetail 121317&amp;nbsp;0 KB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9880 KB&amp;nbsp;0 KB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 KB&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT face=ta&gt;&lt;FONT face=Tahoma&gt;However&lt;/FONT&gt;,&lt;/FONT&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;SELECT count(*) FROM Sales.SalesOrderDetail &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;returns 0.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;You can look at execution plans for queries involving any of the cloned tables and pre-existing indexes. You can create new indexes, but be careful. Any new indexes will have statistics created based on the real data in the clone database, which is 0 rows. So the statistics on your new indexes will not be very accurate.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Of course, your clone database cannot be used for timing tests, or troubleshooting concurrency issues, since there is no data to lock, but for examining how plans change as you rewrite queries, it's a great idea.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=3465" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/metadata/default.aspx">metadata</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/execution+plan/default.aspx">execution plan</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/scripts/default.aspx">scripts</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/statistics/default.aspx">statistics</category></item><item><title>Geek City: Poor (Wo)Man's Load Testing</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/10/24/geek-city-poor-womans-load-testing.aspx</link><pubDate>Wed, 24 Oct 2007 19:28:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3082</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>5</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/3082.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=3082</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last July, &lt;A title="Run a batch multiple times" href="http://sqlblog.com/blogs/kalen_delaney/archive/2007/07/22/did-you-know-run-a-batch-multiple-times.aspx"&gt;I posted about a way to run a batch multiple times&lt;/A&gt; when you use GO as the batch separator. I usually take advantage of this technique when I am loading test data into a table.&lt;/P&gt;
&lt;P&gt;I was mentioning this feature to my class last week in Minneapolis, and one of the students thought that this feature had another use. He thought it would be great to use it to simulate load testing. One connection could execute a procedure and terminate the batch with GO 100 and another connection could be started that did the same thing. You could open up multiple query windows using Management Studio (or Query Analyzer) and have each one run a procedure, or even a statement, over and over again. You could also have different connections run different stored procedures or statements. This will allow you to detect problems with concurrency, which most query tuning techniques do not take into account.&lt;/P&gt;
&lt;P&gt;In the past, I had recommended using the Replay feature of SQL Server Profiler to simulate a "poor man's load testing" environment, but this great idea would make it even easier!&lt;/P&gt;
&lt;P&gt;Of course, for the rich (wo)man, there is also very nice load testing software available. Whether rich or poor, it's crucial to make sure you test your queries and procedures with multiple users. &lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=3082" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/GO/default.aspx">GO</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/testing/default.aspx">testing</category></item><item><title>Did You Know? Run a batch multiple times</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/07/22/did-you-know-run-a-batch-multiple-times.aspx</link><pubDate>Sun, 22 Jul 2007 22:08:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:1880</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>12</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/1880.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=1880</wfw:commentRss><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At first I thought I would just add another sentence to my previous post, but then I realized that this feature is not even documented anywhere, and it might be useful to mention it in its very own post.&amp;nbsp; I have no idea why it is undocumented, but it has been part of all command interfaces to TSQL that I have used for the last 20 years.&lt;/P&gt;
&lt;P&gt;When you use GO as a batch terminator, you can follow it by an integer, which indicates that the batch should be executed N times. &lt;/P&gt;
&lt;P&gt;I use this frequently when populating test tables. In my &lt;A class="" href="http://sqlblog.com/blogs/kalen_delaney/archive/2007/07/22/did-you-know-forcing-a-nonclustered-index-scan-to-avoid-sorting.aspx"&gt;previous post&lt;/A&gt;, I ended with this suggestion:&lt;/P&gt;
&lt;P&gt;-- You can add more rows by just rerunning the INSERT statement from above, as many times as you would like. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, to run the INSERT 5 times, I would do this:&lt;/P&gt;
&lt;P&gt;INSERT INTO details &lt;BR&gt;(SalesOrderID, SalesOrderDetailID, CarrierTrackingNumber, OrderQty, ProductID, SpecialOfferID,&lt;BR&gt;UnitPrice, UnitPriceDiscount, rowguid, ModifiedDate) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT SalesOrderID, SalesOrderDetailID, CarrierTrackingNumber, OrderQty, ProductID, SpecialOfferID,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitPrice, UnitPriceDiscount, rowguid, ModifiedDate&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM Sales.SalesOrderDetail&lt;BR&gt;GO 5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=1880" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/GO/default.aspx">GO</category></item><item><title>Geek City: My New Favorite Tool - SQL Internals Viewer</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/07/19/geek-city-my-new-favorite-tool-sql-internals-viewer.aspx</link><pubDate>Fri, 20 Jul 2007 02:52:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:1843</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>9</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/1843.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=1843</wfw:commentRss><description>&lt;P&gt;At least, I think it might become my new favorite tool.&amp;nbsp; &lt;FONT face=Wingdings&gt;J&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;One of my readers created a tool to graphically display database storage internals, like allocation information, actual page contents, etc. This is just the tool I would have wanted to write if I ever got back to doing any programming. Here's what the author, Danny Gould,&amp;nbsp;says:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;The application acts as a viewer for database internals, including pages and allocation structures. I’ve created it with the aim of it helping people learn and investigate internals. There is more information about it at its website, &lt;A href="http://www.sqlinternalsviewer.com/"&gt;www.sqlinternalsviewer.com&lt;/A&gt; I’ve really enjoyed creating the application and I continue to learn from developing it. I plan to create some online tutorials on how to use it.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Danny would love to get feedback on the tool, as well as suggestions for enhancements. As a sneak preview, here's an image of the tool from the main page of the web site: 
&lt;P&gt;&lt;IMG alt="Allocation Map showing IAM selected in the Database Browser" src="http://www.sqlinternalsviewer.com/Images/object_explorer_iam.png"&gt; 

&lt;EM&gt;&lt;FONT size=1&gt;&lt;BR&gt;Allocation Map showing IAM selected in the Database Browser&lt;/FONT&gt;&lt;/EM&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;&lt;STRONG&gt;~Kalen&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=1843" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/internals/default.aspx">internals</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/allocation+structures/default.aspx">allocation structures</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/storage/default.aspx">storage</category></item></channel></rss>