<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>SQL &amp; LINQ</title>
        <link>http://www.drowningintechnicaldebt.com/DennisBottjer/category/18.aspx</link>
        <description>SQL Server, LINQ to SQL, EF, etc.</description>
        <language>en-US</language>
        <copyright>Dennis Bottjer</copyright>
        <generator>Subtext Version 2.1.2.2</generator>
        <item>
            <title>SQL Reporting Services Error Installing TFS 2010</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2010/09/09/sql-reporting-services-error-installing-tfs-2010.aspx</link>
            <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;&lt;![CDATA[igg_url = "http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2010/09/09/sql-reporting-services-error-installing-tfs-2010.aspx";digg_title = "SQL Reporting Services Error Installing TFS 2010";digg_bgcolor = "#FFFFFF";digg_skin = "normal";]]&gt;&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;&lt;![CDATA[igg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;]]&gt;&lt;/script&gt;&lt;/div&gt;&lt;p&gt;Over the weekend I spun up a new virtual machine for a practice TFS 2010 Installation.  The TFS installation process is much improved.  It can loosely be broken into two phases which are installation and configuration.  The installation is the easy part which basically prepares the server and copies some bits to the drive.  The configuration is a little more difficult but provides some guidance to help make the important decisions.  During the configuration you make the following three key decisions.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Install WSS 3.0 or use an existing SharePoint installation&lt;/li&gt;    &lt;li&gt;Install SQL Express or use an existing SQL Instance&lt;/li&gt;    &lt;li&gt;Install Reporting Services&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;During the configuration I received TF255275 Error during the Reporting Services portion of the configuration.  My reporting services database was created and configured for SharePoint Mode.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Reference: &lt;/strong&gt;&lt;a title="http://www.sathishtk.com/blog/post/2009/10/15/TFS-2010-TF255275-Error.aspx" href="http://www.sathishtk.com/blog/post/2009/10/15/TFS-2010-TF255275-Error.aspx"&gt;&lt;strong&gt;http://www.sathishtk.com/blog/post/2009/10/15/TFS-2010-TF255275-Error.aspx&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Despite referencing the TFS 2010 Beta the above blog post helped resolve the issue.  Essentially, I had to change the database to Native Mode.  However, as a commenter mentions I had to delete the Report Database and recreate it in Native Mode before the configuration wizard would complete.&lt;/p&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/793.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dennis Bottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2010/09/09/sql-reporting-services-error-installing-tfs-2010.aspx</guid>
            <pubDate>Thu, 09 Sep 2010 06:18:01 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2010/09/09/sql-reporting-services-error-installing-tfs-2010.aspx#feedback</comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/793.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Cumulative Update Package 2 for SQL Server 2008 Service Pack 1</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2010/01/03/cumulative-update-package-2-for-sql-server-2008-service-pack.aspx</link>
            <description>&lt;h2&gt;Issues:&lt;/h2&gt;  &lt;p&gt;SharePoint 2010 Foundation and Server require the Cumulative Update Package 2 for SQL Server 2008 Service Pack 1 to use SQL Server 2008 as the backend Database.&lt;/p&gt;  &lt;h2&gt;Solution:&lt;/h2&gt;  &lt;p&gt;SQL Server 2008 will not install properly on Windows 2008 Server without SQL Server 2008 Service Pack 1.  Download &lt;a title="Download SQL Server 2008 Service Pack 1" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19&amp;amp;displaylang=en" target="_blank"&gt;Download SQL Server 2008 Service Pack 1&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;To use SQL Server 2008 for the backend database for SharePoint Foundation or Server download &lt;a title="Download and Install Cumulative Update Package 2 for SQL Server  2008 Service Pack 1" href="http://support.microsoft.com/kb/970315" target="_blank"&gt;Download and Install Cumulative Update Package 2 for SQL Server  2008 Service Pack 1&lt;/a&gt;.  &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note: &lt;/strong&gt;Installing the Cumulative Update Package 2 for SQL Server 2008 Service Pack 1 will update SQL Server’s build number to 10.00.2714.&lt;/p&gt;  &lt;h2&gt;Additional Information:&lt;/h2&gt;  &lt;p&gt;&lt;a title="Fixes Contained in the Cumlative Update" href="http://support.microsoft.com/kb/970365/"&gt;Fixes Contained in the Cumulative Update&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:98d11683-6475-4037-8540-391e2639ad81" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/SharePoint" rel="tag"&gt;SharePoint&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SharePoint+2010" rel="tag"&gt;SharePoint 2010&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SQL+Server+2008" rel="tag"&gt;SQL Server 2008&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SQL+Server+Updates" rel="tag"&gt;SQL Server Updates&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Installing+SQL+2008" rel="tag"&gt;Installing SQL 2008&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/653.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Dennis Bottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2010/01/03/cumulative-update-package-2-for-sql-server-2008-service-pack.aspx</guid>
            <pubDate>Mon, 04 Jan 2010 02:57:06 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2010/01/03/cumulative-update-package-2-for-sql-server-2008-service-pack.aspx#feedback</comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/653.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Oklahoma City SQL Server Developers Group Kick Off Meeting</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2009/04/10/oklahoma-city-sql-server-developers-group-kick-off-meeting.aspx</link>
            <description>&lt;p&gt;Oklahoma City has a new user group thanks to the hard work of Kristin Ferrier.  The Oklahoma City SQL Server Developers Group will meet monthly.  The Group’s first meeting is Monday April 13th.  See details below:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h2&gt;Event Details:&lt;/h2&gt;  &lt;p&gt;We are excited to invite you to the first meeting of the Oklahoma City SQL Server Developers Group! Mike Hotek, former SQL Pass speaker, has graciously agreed to be our first speaker.&lt;/p&gt;  &lt;p&gt;Topic: Q&amp;amp;A with Mike Hotek (open topics are Database Administration and T-SQL in both SQL Server 2005 and 2008)&lt;/p&gt;  &lt;p&gt;Mike will be open to questions on the topics of both database administration and T-SQL with respects to both SQL Server 2005 and 2008. This is a format that Mike has used with great success in a variety of presentation arenas, including SQL Pass.&lt;/p&gt;  &lt;p&gt;Mike is a SQL Server specialist with three decades of experience as a developer and database professional.  He is the Vice-President of FilAm Software Technology, a development company located in the Philippines as well as the Vice-President of MHS Enterprises, a development company based in the Dallas, TX area.  He has deployed applications and environments spanning every feature within the SQL Server product as well as authoring/co-authoring 8 books on SQL Server.&lt;/p&gt;  &lt;p&gt;When: Monday, April 13th   &lt;br /&gt;Time: 6:00 p.m. - 8:00 p.m.    &lt;br /&gt;Location: Oklahoma City Downtown Library (300 Park Avenue) on the 4th Floor in the Friends of the Library Room&lt;/p&gt;  &lt;p&gt;Socialization time will be from 6:00 p.m. - 6:20 p.m. Mike will then begin taking your questions from 6:20 p.m. - 8:00 p.m.&lt;/p&gt;  &lt;p&gt;We would like to thank GDH Consulting for sponsoring the location.    &lt;br /&gt;We would, also, like to thank OakTree Software for donating a grand prize for the first meeting. OakTree will donate a 3-day SQL class (value $1,275). It must be a class that is already running. Here is a link to their schedule - &lt;a href="http://www.oaktreesoftware.com/course_list.aspx"&gt;http://www.oaktreesoftware.com/course_list.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;FYI...No food or drinks will be provided, however, you many bring your own.&lt;/p&gt;  &lt;p&gt;Please RSVP at the following link: &lt;a href="http://www.surveymonkey.com/s.aspx?sm=7Mh_2fXhN0wq_2fzCRnTnUGJbQ_3d_3d"&gt;http://www.surveymonkey.com/s.aspx?sm=7Mh_2fXhN0wq_2fzCRnTnUGJbQ_3d_3d&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c21ff161-8903-41b1-9fe9-0f6ff627fe27" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Oklahoma+City" rel="tag"&gt;Oklahoma City&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SQL+Developers" rel="tag"&gt;SQL Developers&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Oklahoma+Developers" rel="tag"&gt;Oklahoma Developers&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Oklahoma+User+Groups" rel="tag"&gt;Oklahoma User Groups&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/116.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>dbottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2009/04/10/oklahoma-city-sql-server-developers-group-kick-off-meeting.aspx</guid>
            <pubDate>Fri, 10 Apr 2009 09:48:38 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2009/04/10/oklahoma-city-sql-server-developers-group-kick-off-meeting.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/116.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Multi-Tenant Data Architecture Reviewed</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2007/05/08/multi-tenant-data-architecture.aspx</link>
            <description>&lt;p&gt;[Dave] first brought &lt;a title="Multi-Tenant Data Architecture MSDN Article" href="http://msdn2.microsoft.com/en-us/library/aa479086.aspx" target="_blank" rel="nofollow" mce_href="http://msdn2.microsoft.com/en-us/library/aa479086.aspx"&gt;Multi-Tenant Data Architecture MSDN Article&lt;/a&gt; to my attention a few months ago.  Unfortunately, I've had this article in my items to review folder.  Anyway, I finally read the article in detail and thought it quite valuable.  Basically, the article describes several approaches for designing a Multi-Tenant Data Architecture.  It reviews each approach and reviews the pros and cons.&lt;/p&gt;
&lt;p&gt;[RoyAshbrook] blogged his &lt;a title="Roy's thoughts on Multi-Tenant Data Architecture" href="http://drowningintechnicaldebt.com/blogs/royashbrook/archive/2007/03/08/multi_2D00_tenant-architecture.aspx" mce_href="http://drowningintechnicaldebt.com/blogs/royashbrook/archive/2007/03/08/multi_2D00_tenant-architecture.aspx"&gt;thoughts on Multi-Tenant Data Architecture&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/61.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>dbottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2007/05/08/multi-tenant-data-architecture.aspx</guid>
            <pubDate>Wed, 09 May 2007 00:44:00 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2007/05/08/multi-tenant-data-architecture.aspx#feedback</comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/61.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Space Used By SQL Indexes</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2006/10/30/space-used-by-sql-indexes.aspx</link>
            <description>&lt;table style="BORDER-RIGHT: #e5e5e5 1px solid; BORDER-TOP: #e5e5e5 1px solid; BORDER-LEFT: #e5e5e5 1px solid; BORDER-BOTTOM: #e5e5e5 1px solid; BACKGROUND-COLOR: #f2f2f2" cellspacing="0" cellpadding="0" width="100%" border="0"&gt;
&lt;tbody&gt;
&lt;tr style="VERTICAL-ALIGN: top; LINE-HEIGHT: normal"&gt;
&lt;td style="WIDTH: 40px; TEXT-ALIGN: right"&gt;&lt;pre style="BORDER-RIGHT: #e7e7e7 1px solid; PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; MARGIN: 0px; COLOR: gray; PADDING-TOP: 2px; FONT-FAMILY: courier new"&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt; &lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre style="PADDING-RIGHT: 2px; PADDING-LEFT: 8px; PADDING-BOTTOM: 2px; MARGIN: 0px; PADDING-TOP: 2px"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;select&lt;/span&gt; &lt;br /&gt;    [name] &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;As&lt;/span&gt; IndexName,&lt;br /&gt;    type_desc,&lt;br /&gt;    space_used_in_kb = (page_count * 8.0),&lt;br /&gt;    space_used_in_mb = (page_count * 8.0 / 1024.0) &lt;br /&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;from&lt;/span&gt; &lt;br /&gt;    sys.indexes I&lt;br /&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;inner&lt;/span&gt; &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;join&lt;/span&gt;&lt;br /&gt;    sys.dm_db_index_physical_stats(&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;db_id&lt;/span&gt;(), &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object_id&lt;/span&gt;(&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'.'&lt;/span&gt;), &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;, &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;, &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;) P &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;on&lt;/span&gt; I.[&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object_id&lt;/span&gt;] = P.[&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;object_id&lt;/span&gt;] &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;and&lt;/span&gt; I.[index_id] = P.[index_id]&lt;br /&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Order&lt;/span&gt; &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;By&lt;/span&gt;&lt;br /&gt;  space_used_in_kb &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;desc&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/39.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>dbottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2006/10/30/space-used-by-sql-indexes.aspx</guid>
            <pubDate>Mon, 30 Oct 2006 11:59:00 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2006/10/30/space-used-by-sql-indexes.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/39.aspx</wfw:commentRss>
        </item>
        <item>
            <title>SQL Formatting for Easier Debugging</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2006/10/21/sql-formatting-for-easier-debugging.aspx</link>
            <description>&lt;p&gt;
&lt;/p&gt;&lt;table style="BORDER-RIGHT: #e5e5e5 1px solid; BORDER-TOP: #e5e5e5 1px solid; BORDER-LEFT: #e5e5e5 1px solid; BORDER-BOTTOM: #e5e5e5 1px solid; BACKGROUND-COLOR: #f2f2f2" cellspacing="0" cellpadding="0" width="100%" border="0"&gt;
&lt;tbody&gt;
&lt;tr style="VERTICAL-ALIGN: top; LINE-HEIGHT: normal"&gt;
&lt;td style="WIDTH: 40px; TEXT-ALIGN: right"&gt;&lt;pre style="BORDER-RIGHT: #e7e7e7 1px solid; PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; MARGIN: 0px; COLOR: gray; PADDING-TOP: 2px; FONT-FAMILY: courier new"&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt; &lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre style="PADDING-RIGHT: 2px; PADDING-LEFT: 8px; PADDING-BOTTOM: 2px; MARGIN: 0px; PADDING-TOP: 2px"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; [IssueHistoryID]&lt;br /&gt;      ,[StafferID]&lt;br /&gt;      ,[IssueID]&lt;br /&gt;      ,[Comment]&lt;br /&gt;      ,[DateCreated]&lt;br /&gt;  &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; [IssueVision].[dbo].[IssueHistory]&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;This Simple query was created from a demo Microsoft Smart Client Application called IssueVision.  To create it I right clicked on IssueHistory table in SQL Server Management Studio 2005.  Notice the commas are all to the left of the column names.  Commonly, I see queries written like this instead:&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;table style="BORDER-RIGHT: #e5e5e5 1px solid; BORDER-TOP: #e5e5e5 1px solid; BORDER-LEFT: #e5e5e5 1px solid; BORDER-BOTTOM: #e5e5e5 1px solid; BACKGROUND-COLOR: #f2f2f2" cellspacing="0" cellpadding="0" width="100%" border="0"&gt;
&lt;tbody&gt;
&lt;tr style="VERTICAL-ALIGN: top; LINE-HEIGHT: normal"&gt;
&lt;td style="WIDTH: 40px; TEXT-ALIGN: right"&gt;&lt;pre style="BORDER-RIGHT: #e7e7e7 1px solid; PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; MARGIN: 0px; COLOR: gray; PADDING-TOP: 2px; FONT-FAMILY: courier new"&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt; &lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre style="PADDING-RIGHT: 2px; PADDING-LEFT: 8px; PADDING-BOTTOM: 2px; MARGIN: 0px; PADDING-TOP: 2px"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; [IssueHistoryID],&lt;br /&gt;       [StafferID],&lt;br /&gt;       [IssueID],&lt;br /&gt;       [Comment],&lt;br /&gt;       [DateCreated]&lt;br /&gt;  &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; [IssueVision].[dbo].[IssueHistory]&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The first example with the commas on the left is faster to debug and modify. Notice the only modification I need  to make to comment out a column/line is to place "--" in front of the comma as shown below.&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;table style="BORDER-RIGHT: #e5e5e5 1px solid; BORDER-TOP: #e5e5e5 1px solid; BORDER-LEFT: #e5e5e5 1px solid; BORDER-BOTTOM: #e5e5e5 1px solid; BACKGROUND-COLOR: #f2f2f2" cellspacing="0" cellpadding="0" width="100%" border="0"&gt;
&lt;tbody&gt;
&lt;tr style="VERTICAL-ALIGN: top; LINE-HEIGHT: normal"&gt;
&lt;td style="WIDTH: 40px; TEXT-ALIGN: right"&gt;&lt;pre style="BORDER-RIGHT: #e7e7e7 1px solid; PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; MARGIN: 0px; COLOR: gray; PADDING-TOP: 2px; FONT-FAMILY: courier new"&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt; &lt;/pre&gt;&lt;/td&gt;
&lt;td&gt;&lt;pre style="PADDING-RIGHT: 2px; PADDING-LEFT: 8px; PADDING-BOTTOM: 2px; MARGIN: 0px; PADDING-TOP: 2px"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; [IssueHistoryID]&lt;br /&gt;      ,[StafferID]&lt;br /&gt;      ,[IssueID]&lt;br /&gt;      ,[Comment]&lt;br /&gt;    --,[DateCreated]&lt;br /&gt;  &lt;span style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; [IssueVision].[dbo].[IssueHistory]&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;I realize this tip is a subtle point.  Seems a little strange that I'm actually analizing the placement of a comma.  However, I have become quite fond of this style b/c it saves time and helps me to reduce simple syntax mistakes while testing/debugging large sprocs.  Try it with some more complex SQL and see what you think.&lt;/p&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/38.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>dbottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2006/10/21/sql-formatting-for-easier-debugging.aspx</guid>
            <pubDate>Sat, 21 Oct 2006 11:03:00 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2006/10/21/sql-formatting-for-easier-debugging.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/38.aspx</wfw:commentRss>
        </item>
        <item>
            <title>SQL Query By Year</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/12/10/query-by-year.aspx</link>
            <description>&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;Say you want to query a table returning all the records from a certain year.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;An easy way to do this is to use SQL’s Year Function as follows:&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;Select * From &amp;lt;Table&amp;gt; Where Year(&amp;lt;DateTimeField&amp;gt;) = 2006&lt;/p&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/21.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>dbottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/12/10/query-by-year.aspx</guid>
            <pubDate>Sat, 10 Dec 2005 07:12:00 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/12/10/query-by-year.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/21.aspx</wfw:commentRss>
        </item>
        <item>
            <title>SQL Table Naming Conventions</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/09/23/sql-table-naming-conventions.aspx</link>
            <description>&lt;p&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;How do you name your SQL Tables?&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;Are the names singular or plural?&lt;span style="mso-spacerun: yes"&gt;  A friend&lt;/span&gt; suggested that tables should be singular because they represent a single record instance of data stored in the table.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;When multiple records are selected then a collection is created.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;For example, if you create a table called student each record in that table represents one student.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;Each row or record in the student table represents one instant of the student table.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;If you select several students from the student table you are creating a collection of student records.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;The collection should be plural not the table name.&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/18.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>dbottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/09/23/sql-table-naming-conventions.aspx</guid>
            <pubDate>Fri, 23 Sep 2005 05:34:00 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/09/23/sql-table-naming-conventions.aspx#feedback</comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/18.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Stored Procs Vs. Dynamic SQL</title>
            <link>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/08/02/stored-procs-vs.-dynamic-sql.aspx</link>
            <description>&lt;p&gt;There are many great topics of debate in software development.  DataSets Vs. Objects, Smart Clients Vs. Web Apps, and Stored Procs Vs. Dynamic SQL.  Many have argued that writing stored procedures is rigid and doesn't allow for an easy way to build detailed where clauses.  Furthermore, SQL Server 2000 caches execution plans so in theory SQL Statements should be optimized if used often.  Finally, .NET allows for parameterized queries helping to protect dynamic queries from SQL Interjection.  &lt;/p&gt;
&lt;p&gt;Even with these arguements against stored procedures the arguements for them are greater.  First, Stored Procs use less bandwidth to do the same amount of work as a dynamic query.  For example, if my client application is using dynamic SQL then it has to pass the entire SQL statement to the SQL Server for processing.  In contrast, if the client application is using stored procedures all it has to do is call the stored procedure by name and pass to that procedure any required parameters.  By using stored procedures less information is sent from the client to the server to do the same amount of work.  Note: This can also be viewed as a security benefit because less information is being transmitted accross the wire that describes the exact design of your database.  Next, Stored Procedures can be controlled by database security.  That is a user be denied access to the tables within a database but be granted access through stored procedures.  The stored procedures become the only way that user can read, add, update, or delete data from the database.  Using stored procedures provides a useful layer of abstraction and a cleaner application design  It is possible for a change to be made within a store procedure that will not require modifications to the application.  If the client application were using dynamic sql such changes could only be made through a code change and then a redployment.  Store Procedures can implement batch processing easier and more effectively than dynamic SQL. &lt;/p&gt;&lt;img src="http://www.drowningintechnicaldebt.com/DennisBottjer/aggbug/11.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>dbottjer</dc:creator>
            <guid>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/08/02/stored-procs-vs.-dynamic-sql.aspx</guid>
            <pubDate>Tue, 02 Aug 2005 06:16:00 GMT</pubDate>
            <comments>http://www.drowningintechnicaldebt.com/DennisBottjer/archive/2005/08/02/stored-procs-vs.-dynamic-sql.aspx#feedback</comments>
            <wfw:commentRss>http://www.drowningintechnicaldebt.com/DennisBottjer/comments/commentRss/11.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
