<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://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>Search results matching tags 'DBA' and 'Testing'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=DBA,Testing&amp;orTags=0</link><description>Search results matching tags 'DBA' and 'Testing'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Spit it out already!</title><link>http://sqlblog.com/blogs/buck_woody/archive/2010/01/06/spit-it-out-already.aspx</link><pubDate>Wed, 06 Jan 2010 14:11:11 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:20617</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;You’ve probably seen that commercial where the chewing-gum company van stalks the guy who has been chewing the same piece of gum too long, and they attack him and make him chew another piece.&lt;/p&gt;  &lt;p&gt;I feel like that with SQL Server 2000. Almost every shop I go into has at least one primary application running on SQL Server 2000. Now, don’t get me wrong – SQL Server 2000 is a fine piece of software engineering. From over TEN YEARS AGO. In “software time”,&amp;#160; that’s like a thousand years or something. &lt;/p&gt;  &lt;p&gt;While it was great for its day, the newer versions are faster, more secure, and more robust. And every time it doesn’t get upgraded, SQL Server is perceived as “not as fast/strong/etc” as other platforms (which &lt;em&gt;are&lt;/em&gt; upgraded, of course).&lt;/p&gt;  &lt;p&gt;Now, I’m not suggesting that anyone upgrade for upgrade’s sake. We all have work to do, and the last thing we need to do is change out a platform when there’s no need. &lt;/p&gt;  &lt;p&gt;But there is a need. SQL Server 2000 isn’t in mainline support any more. That means it can be attacked easier and so on. And it doesn’t scale like the new offerings, nor does it have any of the new features the latest versions have. &lt;/p&gt;  &lt;p&gt;“Oh”, you might say, “I don’t use those features anyway.” Well of course you don’t – you can’t if you still have SQL Server 2000! How do you know the ways you could help your organization if you don’t experiment with the new stuff?&lt;/p&gt;  &lt;p&gt;But it isn’t the DBA I would chase down and steal gum from. It’s the &lt;em&gt;vendors&lt;/em&gt;. &lt;/p&gt;  &lt;p&gt;Every time I raise my eyebrows when I hear about the SQL Server 2000 installs, the DBA shrugs and says “The vendor won’t certify SQL Server X, so we have to stay at SQL Server 2000 or 2005.” And I say, that’s just &lt;em&gt;lazy&lt;/em&gt;. Unless the vendor codes specifically for deprecated features, a simple test run during their software development should allow them to move forward. I’m not saying that’s an easy task, but certainly they’ve tested their software releases once in the last ten years, no? If not, doesn’t that make you nervous?&lt;/p&gt;  &lt;p&gt;Anyhoo, spit out the SQL Server 2000. Or I might have to fire up the company van.&lt;/p&gt;</description></item><item><title>After the Upgrade, it runs differently…</title><link>http://sqlblog.com/blogs/buck_woody/archive/2009/12/01/after-the-upgrade-it-runs-differently.aspx</link><pubDate>Tue, 01 Dec 2009 16:06:55 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:19385</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;I got a question yesterday in the mail that I thought I would just answer here in a broad context. While I can’t troubleshoot or do performance tuning from a distance, there are some interesting concepts and suggestions this e-mail brings up:&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000" size="1"&gt;“I have recently seen a change from SQL Server from 2005 to 2008 in where it handles CASE statements differently. Previously we saw a tremendous improvement in performance by using CASE statements instead of OR statements. However when one of our client upgraded to 2008 they began to notice unusually long runtimes with a few of these queries (orders of magnitude larger runtimes). Swapping it to an OR statement allows it to run in 0.075 seconds... so my question to you is do you know of any changes to the exectution engine that would account for this and what is your recommendation?”&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;It’s a great question. Basically it boils down to “I changed versions, now something acts differently.” Before we talk about what might be the issue, let’s talk about some things you should do after you upgrade from one version of SQL Server to another.&lt;/p&gt;  &lt;p&gt;First, open the database properties and change the compatibility level to 10.0, unless you know you shouldn’t. Next, update your statistics – all of them. Third, ensure you have all of the proper service packs applied to the operating system and SQL Server. And finally, check the code you have for deprecated statements, or for places where you could optimize the code to use new statements or formats. There are other steps to follow, but these basics will help.&lt;/p&gt;  &lt;p&gt;Now, with all of that done, let’s move on to things that work differently. First, you need to find out what the&amp;#160; code is doing – and the primary way to do that is to examine the Query Execution Plan. There are a lot of resources to teach you how to do that, but the general idea is that you turn that plan on (in the Query menu), run the query, look at the graphical plan and check three items: the overall plan, the icons that show the highest percentage of use, and the thickest arrows. Evaluating this on the “before” system and the “after” system, and that will show you what changed.&lt;/p&gt;  &lt;p&gt;Maybe.&lt;/p&gt;  &lt;p&gt;The point is, the query might take exactly the same path, but a different component may show stress because you might have a different box or configuration. Perhaps the drive layouts changed (or should), you have more memory (or better access to it) and so on. In that case, you simply follow standard performance tuning methodologies to locate what’s waiting, and what is showing pressure.&lt;/p&gt;  &lt;p&gt;Now to the question at hand – does SQL Server (any version) handle a CASE statement differently than an OR statement? Well, once again, the execution plan will show you that answer, but the CASE statement is used for a different purpose than an OR statement – without having all of the code it’s difficult to say which to use in a given situation. The best thing to do is to evaluate the documentation on each and decide which fits the situation best.&lt;/p&gt;  &lt;p&gt;CASE: &lt;a title="http://msdn.microsoft.com/en-us/library/ms181765.aspx" href="http://msdn.microsoft.com/en-us/library/ms181765.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms181765.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;OR: &lt;a title="http://msdn.microsoft.com/en-us/library/ms188361.aspx" href="http://msdn.microsoft.com/en-us/library/ms188361.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms188361.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Did we make changes to CASE or OR? Not directly – but each change to the product may have orthogonal implications, which is where I point you back to the steps I mentioned for the “after upgrade” process.&lt;/p&gt;</description></item></channel></rss>