<?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 'Development' and 'Documentation'</title><link>http://sqlblog.com/search/SearchResults.aspx?o=DateDescending&amp;tag=Development,Documentation&amp;orTags=0</link><description>Search results matching tags 'Development' and 'Documentation'</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Windows Azure End to End Examples</title><link>http://sqlblog.com/blogs/buck_woody/archive/2012/05/29/windows-azure-end-to-end-examples.aspx</link><pubDate>Tue, 29 May 2012 13:45:59 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:43642</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;I’m fascinated by the way people learn. I’m told there are several methods people use to understand new information, from reading to watching, from experiencing to exploring. &lt;/p&gt;  &lt;p&gt;Personally, I use multiple methods of learning when I encounter a new topic, usually starting with reading a bit about the concepts. I quickly want to put those into practice, however, especially in the technical realm. I immediately look for examples where I can start trying out the concepts. But I often want a “real” example – not just something that represents the concept, but something that is real-world, showing some feature I could actually use. &lt;/p&gt;  &lt;p&gt;And it’s no different with the Windows Azure platform – I like finding things I can do now, and actually use. So when I started learning Windows Azure, &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=8396" target="_blank"&gt;I of course began with the Windows Azure Training Kit&lt;/a&gt; – which has lots of examples and labs, presentations and so on. But from there, I wanted more examples I could learn from, and eventually teach others with. I was asked if I would write a few of those up, so here are the ones I use. &lt;/p&gt;  &lt;h2&gt;CodePlex&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://www.codeplex.com/" target="_blank"&gt;CodePlex is Microsoft’s version of an “Open Source” repository&lt;/a&gt;. Anyone can start a project, add code, documentation and more to it and make it available to the world, free of charge, using various licenses as they wish. Microsoft also uses this location for most of the examples we publish, and sample databases for SQL Server. &lt;/p&gt;  &lt;p&gt;If you search in CodePlex for “Azure”, you’ll come back with a list of projects that folks have posted, including those of us at Microsoft. The source code and documentation are there, so you can learn using actual examples of code that will do what you need. There’s everything from a simple table query to &lt;a href="http://blobshare.codeplex.com/" target="_blank"&gt;a full project that is sort of a “Corporate Dropbox” that uses Windows Azure Storage&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;The advantage is that this code is immediately usable. It’s searchable, and you can often find a complete solution to meet your needs. The disadvantage is that the code is pretty specific – it may not cover a huge project like you’re looking for. Also, depending on the author(s), you might not find the documentation level you want. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Link: &lt;a href="http://azureexamples.codeplex.com/site/search?query=Azure&amp;amp;ac=8"&gt;http://azureexamples.codeplex.com/site/search?query=Azure&amp;amp;ac=8&lt;/a&gt;&amp;#160;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Tailspin&lt;/h2&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/practices/default" target="_blank"&gt;Microsoft Patterns and Practices&lt;/a&gt; is a group here that does an amazing job at sharing standard ways of doing IT – from operations to coding. If you’re not familiar with this resource, make sure you read up on it. Long before I joined Microsoft I used their work in my daily job – saved a ton of time. It has resources not only for Windows Azure but other Microsoft software as well. &lt;/p&gt;  &lt;p&gt;The Patterns and Practices group also publishes full books – you can buy these, but many are also online for free. There’s an end-to-end example for Windows Azure using a company called “Tailspin”, and the work covers not only the code but the design of the full solution. If you really want to understand the thought that goes into a Platform-as-a-Service solution, this is an excellent resource. &lt;/p&gt;  &lt;p&gt;The advantages are that this is a book, it’s complete, and it includes a discussion of design decisions. The disadvantage is that it’s a little over a year old – and in “Cloud” years that’s a lot. So many things have changed, improved, and have been added that you need to treat this as a resource, but not the only one. Still, highly recommended. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Link: &lt;a href="http://msdn.microsoft.com/en-us/library/ff728592.aspx"&gt;http://msdn.microsoft.com/en-us/library/ff728592.aspx&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;h2&gt;Azure Stock Trader&lt;/h2&gt;  &lt;p&gt;Sometimes you need a mix of a CodePlex-style application, and a little more detail on how it was put together. And it would be great if you could actually play with the completed application, to see how it really functions on the actual platform.&lt;/p&gt;  &lt;p&gt;That’s the Azure Stock Trader application. There’s a place where you can read about the application, and then it’s been published to Windows Azure – the production platform – and you can use it, explore, and see how it performs. &lt;/p&gt;  &lt;p&gt;I use this application all the time to demonstrate Windows Azure, or a particular part of Windows Azure.&lt;/p&gt;  &lt;p&gt;The advantage is that this is an end-to-end application, and online as well. The disadvantage is that it takes a bit of self-learning to work through.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Links: Learn it: &lt;a href="http://msdn.microsoft.com/en-us/netframework/bb499684"&gt;http://msdn.microsoft.com/en-us/netframework/bb499684&lt;/a&gt; Use it: &lt;a href="https://azurestocktrader.cloudapp.net/"&gt;https://azurestocktrader.cloudapp.net/&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Cloud Computing and the Importance of Code Diagrams</title><link>http://sqlblog.com/blogs/buck_woody/archive/2011/05/03/cloud-computing-and-the-importance-of-code-diagrams.aspx</link><pubDate>Tue, 03 May 2011 13:59:20 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:35407</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;Most mature development shops use various code diagrams to give a symbolic representation of high-level and database code structures. Standards such as &lt;a href="http://www.bpmb.de/images/BPMN2_0_Poster_EN.pdf" target="_blank"&gt;Business Process Model Notation&lt;/a&gt; (BPMN), &lt;a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=62" target="_blank"&gt;Entity Relationship Diagrams&lt;/a&gt; (ERD) and the &lt;a href="http://uml.org/" target="_blank"&gt;Unified Modeling Language&lt;/a&gt; (UML) are a few I use all the time. &lt;/p&gt;  &lt;p&gt;In the Distributed Computing (Cloud Computing) paradigm, these three diagrams (or their equivalent) become essential. In the past, I’ve been able to rely on a single architecture where my code will run. I understand the servers, the networking and the path the code takes between the client and the components within that architecture.&lt;/p&gt;  &lt;p&gt;With Distributed Computing (DC), the architecture changes. In fact, the reason I use the term “Distributed Computing” instead of “Cloud Computing” most often (except in the title of this post, as you can see) is that I feel it’s more technically accurate about how we write code. I don’t view DC coding as an “all or nothing” exercise – I view it as just another option to solve a computing problem. A “hybrid” approach, where I mix in the strengths of a cloud provider is often a great way to leverage the best cost, performance and other advantages of each part of your solution. It can also help keep data secure, provide options for High Availability and Disaster Recovery, and more.&lt;/p&gt;  &lt;p&gt;To gain these advantages, we have to think more about the components of the application rather than a monolithic stack of components in a single architecture. And that brings us to the title of this post…&lt;/p&gt;  &lt;p&gt;For us to correctly identify code components, database objects, security paths and other elements, we have to be able to conceptualize them. And that’s where those diagrams come into play. Starting with some sort of business or organizational need, we can use BPMN or UML Actor diagrams to explain what the program needs to do. That helps segregate the security and location requirements. For instance, if&amp;#160; the BPMN shows a data access to Private Information, we can evaluate the need for an on-premise system that is federated to a DC provider. If the business users need global access, we can decide whether to set up a VPN to allow access to an on-premise system or whether a login component can be used on the web.&lt;/p&gt;  &lt;p&gt;After determining the flow of the program, move on to the data the system will store. In the case of Windows and SQL Azure, there are several options for storing data. In the past, I’ve often selected a single storage type, such as an RDBMS, and stored program data there. Now we can store in multiple formats, in multiple locations and more. The ERD is pivotal, because it defines data types, which can help decisions around where things go. Another important aspect to the data decision which is not covered in an ERD (but perhaps should be) is the estimated size and growth of a datum, since that can also drive the decision on where to put a data component.&lt;/p&gt;  &lt;p&gt;From there, the UML document helps me understand where each computing element can live. There are strengths for each type of computing, and using the UML diagram I can place each code component in the best environment for speed, security and other considerations.&lt;/p&gt;  &lt;p&gt;So in the new Distributed Computing world, these graphical documents do much more than just help design the application – they can help define the architecture as well.&lt;/p&gt;</description></item><item><title>SQL Server Best Practices: Protect CmdExec</title><link>http://sqlblog.com/blogs/buck_woody/archive/2009/12/03/sql-server-best-practices-protect-cmdexec.aspx</link><pubDate>Thu, 03 Dec 2009 15:49:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:19482</guid><dc:creator>BuckWoody</dc:creator><description>&lt;p&gt;In SQL Server, there are times that you need to do things in the operating system, and to allow that there is a feature called CmdExec. This is not always a good thing –whenever you leave the confines of SQL Server and go out to the operating system, you can cause issues, not the least of which are security-related.&lt;/p&gt;  &lt;p&gt;This best practice is primarily aimed at SQL Server 2000 – in SQL Server 2005 and higher, you’ll have these as job step types in SQL Server Agent (or ActiveX). What you should to do is ensure that only the sysadmins role can run CmdExec job steps.&lt;/p&gt;  &lt;p&gt;In SQL Server 2005 and higher, you should use other methods to work with the operating system, such as SQL CLR or PowerShell to handle that with better safety and security. &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>