Louis Davidson : SQL Serverhttp://sqlblog.com/blogs/louis_davidson/archive/tags/SQL+Server/default.aspxTags: SQL ServerenCommunityServer 2.1 SP2 (Build: 61129.1)MVP/SQLPASS Summit Wrapup From a Non-Attendeehttp://sqlblog.com/blogs/louis_davidson/archive/2014/11/09/mvp-sqlpass-summit-wrapup-from-a-non-attendee.aspxMon, 10 Nov 2014 01:39:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:56349drsql4http://sqlblog.com/blogs/louis_davidson/comments/56349.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=56349http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=56349(Or “How I Sort of Attended PASS This Year After All and It Wasn’t as Horrible as it Might Have Been”) Wow, my experience at this year’s MVP Summit and PASS Summit was not at all what I had expected it to be for me just weeks ago when I was planning my...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2014/11/09/mvp-sqlpass-summit-wrapup-from-a-non-attendee.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=56349" width="1" height="1">MVPMVP SummitPASS SummitSpeakingSQL ServerSQLPASSHow In-Memory Database Objects Affect Database Design: Uniquenesshttp://sqlblog.com/blogs/louis_davidson/archive/2014/07/06/how-in-memory-database-objects-affect-database-design-uniqueness.aspxSun, 06 Jul 2014 20:15:56 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:54426drsql0http://sqlblog.com/blogs/louis_davidson/comments/54426.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=54426http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=54426This part is part of an ongoing series of blogs I am writing while preparing to give a presentation based on the prefix of this blog's title. It is a work in progress as I explore the effects of the new in-memory model. I would love comments that tell...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2014/07/06/how-in-memory-database-objects-affect-database-design-uniqueness.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=54426" width="1" height="1">Database DesignIn-Memory OLTPPASSSpeakingSQL ServerHow In-Memory Database Objects Affect Database Design: Or does it?http://sqlblog.com/blogs/louis_davidson/archive/2014/06/30/how-in-memory-database-objects-affect-database-design-or-does-it.aspxMon, 30 Jun 2014 21:03:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:54341drsql2http://sqlblog.com/blogs/louis_davidson/comments/54341.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=54341http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=54341This part is part of an ongoing series of blogs I am writing while preparing to give a presentation based on the prefix of this blog's title. It is a work in progress as I explore the effects of the new in-memory model. I would love comments that tell...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2014/06/30/how-in-memory-database-objects-affect-database-design-or-does-it.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=54341" width="1" height="1">Database DesignIn-Memory OLTPPASSSpeakingSQL ServerHow In-Memory Database Objects Affect Database Design: The Logical and Physical Modelshttp://sqlblog.com/blogs/louis_davidson/archive/2014/06/28/how-in-memory-database-objects-affect-database-design-the-logical-and-physical-models.aspxSat, 28 Jun 2014 20:04:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:54340drsql1http://sqlblog.com/blogs/louis_davidson/comments/54340.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=54340http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=54340This part is part of an ongoing series of blogs I am writing while preparing to give a presentation based on the prefix of this blog's title. It is a work in progress as I explore the effects of the new in-memory model. I would love comments that tell...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2014/06/28/how-in-memory-database-objects-affect-database-design-the-logical-and-physical-models.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=54340" width="1" height="1">Database DesignIn-Memory OLTPPASSSpeakingSQL ServerSpeaking this weekend at SQL Saturday 286 - Louisvillehttp://sqlblog.com/blogs/louis_davidson/archive/2014/06/19/speaking-this-weekend-at-sql-saturday-286-louisville.aspxFri, 20 Jun 2014 03:20:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:54243drsql0http://sqlblog.com/blogs/louis_davidson/comments/54243.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=54243http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=54243Wow, where does the time go? Hope I see every reader there in Louisville this weekend for a lovely time. Say you live in Alaska and it would be too far to go in one day? Hey, we all have our problems ( and don't tell anyone, but I am going to try to finish...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2014/06/19/speaking-this-weekend-at-sql-saturday-286-louisville.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=54243" width="1" height="1">Database DesignSpeakingSQL SaturdaySQL ServerSQLPASSWritingHow In-Memory Database Objects Affect Database Design: Getting Startedhttp://sqlblog.com/blogs/louis_davidson/archive/2014/03/10/how-in-memory-database-objects-affect-database-design-getting-started.aspxTue, 11 Mar 2014 00:05:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:53062drsql0http://sqlblog.com/blogs/louis_davidson/comments/53062.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=53062http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=53062Weird, somehow I lost text in the middle of this post after it was posted... I created it a few days back and set it to post later... Corrected. So I put in the following abstract for Devlink (and may for SQL Saturday Orlando and/or PASS Summit.) I don't...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2014/03/10/how-in-memory-database-objects-affect-database-design-getting-started.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=53062" width="1" height="1">Database DesignIn-Memory OLTPSpeakingSQL ServerWhy We Write #1 - An Interview With Thomas LaRockhttp://sqlblog.com/blogs/louis_davidson/archive/2013/03/21/why-we-write-1-an-interview-with-thomas-larock.aspxFri, 22 Mar 2013 00:03:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:48340drsql2http://sqlblog.com/blogs/louis_davidson/comments/48340.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=48340http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=48340I 've been a writer of trade level technical materials for over 13 years now, writing books, articles, blogs, and even tweets for a variety of outlets, almost exclusively about Microsoft SQL Server. While I won't claim to be the best writer in the world,...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2013/03/21/why-we-write-1-an-interview-with-thomas-larock.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=48340" width="1" height="1">SQL ServerSQLPASSWhy We WriteWritingChapter 7–Enforced Data Protectionhttp://sqlblog.com/blogs/louis_davidson/archive/2011/06/21/chapter-7-enforced-data-protection.aspxTue, 21 Jun 2011 04:36:13 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:36380drsql0http://sqlblog.com/blogs/louis_davidson/comments/36380.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=36380http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=36380As the book progresses, I find myself veering from the original stated outline quite a bit, because as I teach about this more (and I am teaching a daylong db design class in August at http://www.sqlsolstice.com/ … shameless plug, but it is on topic :)...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2011/06/21/chapter-7-enforced-data-protection.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=36380" width="1" height="1">Database DesignSQL ServerWritingSee you in Columbus Saturday?http://sqlblog.com/blogs/louis_davidson/archive/2011/06/06/see-you-in-columbus-saturday.aspxMon, 06 Jun 2011 04:32:45 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:36088drsql2http://sqlblog.com/blogs/louis_davidson/comments/36088.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=36088http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=36088Assuming all goes as planned, I will be in Columbus, OH this Friday night and Saturday for SQL Saturday 75 . I really love SQL Saturday events the best of all of the events because they are very intimate in nature. As a fairly antisocial person, I sometimes...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2011/06/06/see-you-in-columbus-saturday.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=36088" width="1" height="1">Database DesignPASSSpeakingSQL SaturdaySQL ServerNormalization and How to Know When You Are Done… The short version…http://sqlblog.com/blogs/louis_davidson/archive/2011/05/29/normalization-and-how-to-know-when-you-are-done-the-short-version.aspxSun, 29 May 2011 20:54:15 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:35960drsql2http://sqlblog.com/blogs/louis_davidson/comments/35960.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=35960http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=35960A while back, I was working on a short article about Normalization for a book that never got published (admittedly I wasn’t getting paid for the article, and it wasn’t for charity, so I wasn’t that broken up over it.)&#160; The task at hand was to, in...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2011/05/29/normalization-and-how-to-know-when-you-are-done-the-short-version.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=35960" width="1" height="1">Database DesignDesignDevelopmentNormalizationSQL ServerTerminologyWritingQuest DMV Breakfast Code – Disk IOhttp://sqlblog.com/blogs/louis_davidson/archive/2009/11/04/quest-dmv-breakfast-code-disk-io.aspxWed, 04 Nov 2009 17:52:43 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:18532drsql1http://sqlblog.com/blogs/louis_davidson/comments/18532.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=18532http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=18532For any of you who attended the Quest breakfast at PASS (and anyone else really) I wanted to go ahead and post the code and give a little wrap up/explanation. (I will post the stuff on perf counters later. They are cool, but this is really what I wanted...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2009/11/04/quest-dmv-breakfast-code-disk-io.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=18532" width="1" height="1">Dynamic ManagementPASSSpeakingSQL ServerSQL TechniquesSQL ToolsFifth pillar - Securehttp://sqlblog.com/blogs/louis_davidson/archive/2009/10/06/fifth-pillar-secure.aspxTue, 06 Oct 2009 23:52:42 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:17330drsql1http://sqlblog.com/blogs/louis_davidson/comments/17330.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=17330http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=17330As I have mentioned in all of the previous posts, basic functionality is the foundation of any system. So it goes without saying that if you have just implemented a payroll system, everyone is getting paid.&#160; To meet the basic bar that EVERYONE agrees...(<a href="http://sqlblog.com/blogs/louis_davidson/archive/2009/10/06/fifth-pillar-secure.aspx">read more</a>)<img src="http://sqlblog.com/aggbug.aspx?PostID=17330" width="1" height="1">Database DesignPillarsSecuritySQL ServerHeaded..South..To Atlanta for SQL Saturdayhttp://sqlblog.com/blogs/louis_davidson/archive/2009/04/23/headed-south-to-atlanta.aspxFri, 24 Apr 2009 02:55:00 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:13489drsql3http://sqlblog.com/blogs/louis_davidson/comments/13489.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=13489http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=13489<P>Heading down to SQL Saturday (<A href="http://www.sqlsaturday.com/">www.sqlsaturday.com</A>) in Atlanta to give a 9:15 AM session on Database Design, with a greater than normal dose of normal thrown in. I hope there are more than 7 people to show up, because I would hate if everyone got some swag (I usually like tossing out stuff when people make cool and interesting statements, and NOT when they prove me wrong…you know who (all) you are :). Apparently they were at their capacity, so maybe not.&nbsp; If you need to know where it is, check here: <A title=http://www.sqlsaturday.com/eventhome.aspx?eventid=17 href="http://www.sqlsaturday.com/eventhome.aspx?eventid=17">http://www.sqlsaturday.com/eventhome.aspx?eventid=17</A>, and come on out.&nbsp; The more smart alecky know-it-alls I get who want to prove me wrong the better…well, as long as you sit there quietly and learn something…</P>
<P>(Hmm… I hasten to send you that link (<A href="http://www.sqlsaturday.com/">www.sqlsaturday.com</A>), because frankly you will have to see that someone has a bad where clause on a query somewhere. I would offer up prizes for the best guess, but every time I do contests no one ever gets it or even tries.)</P>
<DIV class=wlWriterHeaderFooter style="PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-BOTTOM:0px;MARGIN:0px;PADDING-TOP:0px;">
<P><A></A></P></DIV><img src="http://sqlblog.com/aggbug.aspx?PostID=13489" width="1" height="1">SpeakingSQL ServerCommenting your codehttp://sqlblog.com/blogs/louis_davidson/archive/2008/07/30/commenting-your-code.aspxThu, 31 Jul 2008 02:19:43 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:8132drsql8http://sqlblog.com/blogs/louis_davidson/comments/8132.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=8132http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=8132<p>As I am easing back into real life from writing the book, I am in search of easy targets for blogging.&#160; My boss mentioned <a href="http://www.codinghorror.com/blog/archives/001150.html" target="_blank">this blog</a> over on Jeff Atwood's Coding Horror Blog and it got me thinking about commenting.&#160; His advice is to only comment &quot;why&quot; the code works.&#160; I can't quite agree, because the code he claims to be acceptable is:</p> <p><font face="Courier New" size="2">private double SquareRootApproximation(n) { <br /></font><font face="Courier New" size="2">&#160; r = n / 2; <br />&#160; while ( abs( r - (n/r) ) &gt; t ) { <br />&#160;&#160;&#160; r = 0.5 * ( r + (n/r) ); <br />&#160; } <br />&#160; return r; <br />} <br />System.out.println( &quot;r = &quot; + SquareRootApproximation(r) );</font></p> <p>I mean, it is better than some code I have seen,&#160; but still, I would like a bit more information about why this works.&#160; Maybe the name of the algorithm used, or at least what to do if this fails to provide the expected results.&#160; Admittedly this is probably something that could be easily found, but most algorithms are not.&#160; Comments in my mind should at least lead you to understand the mindset of the programmer.&#160; What would actually improve this code in my mind is to change the variables to full words (though in this case it might not make sense to do this.) </p> <p>On an extremely different side of things is <a href="http://www.mssqltips.com/tip.asp?tip=1213" target="_blank">this article</a> from &quot;<a href="http://www.mssqltips.com/author.asp?authorid=11">Edgewood Solutions Engineers</a>&quot; on mssqltips.com. Their answer is to explain what the code is doing in simple terms, making sure to comment almost everything.&#160; They have a very elaborate header devised, with dependencies, both users of the object and objects it used.&#160; Most of what is said seems a bit like overkill, but their point here &quot;Comment all of the major code blocks of the code and the critical minor points that can be easily overlooked such as a obscure WHERE clause.&quot; is a good one.&#160; I generally pepper my code with comments where I think it will be hard to debug for myself later, with a consideration for others, particularly when those others will call me to explain the code.</p> <p>Which brings me to my commenting philosophy. I personally think you have to comment to the expected lowest common denominator.&#160; Think of the dumbest person who could have the need to read your code who is also qualified to have their job (otherwise you would have to write instructions on every line of code). If the qualified person can figure out what you are doing just by your naming conventions and , then it doesn't need comments. But if that person would look at the code and reasonable figure it out, then there is no need to comment the code.&#160; What this requires is a few things:</p> <ul> <li><strong>Naming objects</strong> - if your procedures, tables, columns, functions all have meaningful names, you won't have to explain what they mean, saving time</li> <li><strong>Good design</strong> - if the relationship between objects and the cardinality of those relationships is clear, then you don't need to explain that what you are doing is hack due to poor thinking...</li> <li><strong>Naming variables</strong> - probably the most important thing to avoid the need for comments is naming stuff.&#160; Name variables with words, not single character values (except sometimes i, x, etc will suffice for obvious typical uses)</li> <li><strong>Reasonable code formatting</strong> - SQL has no real form, so you <em>could</em> write procedures on a single line.&#160; You could.&#160; You could smash your hand with a hammer too.&#160; Neither action would be very good.&#160; (Consider using Red-Gate's SQL Refactor tool if nothing else.)</li> </ul> <p>However, the fact is, for SQL code, the real problem comes in when you start coming up with cool relational methods of solving problems that most moderately qualified people wouldn't get. For example the trick of using a sequence table to break apart a comma delimited list. Couple that with a join and you get some amazingly cool code, but how do you comment it?</p> <p>For example, say an architect that shouldn't be an architect designs a table with a comma delimited list like this (didn't I mention good design earlier?&#160; I hate having to say this is a hack, but it is an elegant hack...)</p> <p><em><font color="#008000">--excerpted from Chapter 7 of </font></em><a href="http://www.apress.com/book/view/143020866x" target="_blank"><em><font color="#008000">Pro SQL Server 2008 Relational Database Design and Implementation</font></em></a> <br /><font face="Courier New" size="2">CREATE TABLE poorDesign <br />( <br />&#160;&#160;&#160;&#160; poorDesignId int, <br />&#160;&#160;&#160;&#160; badValue varchar(20) <br />)</font></p> <p><font face="Courier New" size="2">INSERT INTO poorDesign --using 2008 syntax <br />VALUES (1,'1,3,56,7,3,6'), <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2,'22,3'), <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3,'1')</font></p> <p><font face="Courier New" size="2"></font>You can &quot;normalize&quot; this set using a table of numbers (in my examples named tools.sequence) and a really cool join:</p> <p><font face="Courier New" size="2">SELECT&#160;&#160;&#160; poorDesign.poorDesignId as betterDesignId, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SUBSTRING(',' + poorDesign.badValue + ',',i + 1, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; CHARINDEX(',',',' + poorDesign.badValue + ',',i + 1) - i - 1) <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font><font face="Courier New" size="2">as betterScalarValue <br />FROM&#160;&#160;&#160;&#160; poorDesign <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; JOIN tools.sequence <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; on i &gt;= 1 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AND i &lt; LEN(',' + poorDesign.badValue + ',') - 1 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AND SUBSTRING(',' + + poorDesign.badValue + ',', i, 1) = ','</font></p> <p>But are there enough pixels available on the planet to make that more understandable to most SQL programmers? Even the reasonably qualified?&#160;&#160; I mean, I am still kind of amazed at the technique and the fact that it returns the following:</p> <p><font face="Courier New" size="2">betterDesignId betterScalarValue <br />-------------- ----------------- <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 56 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 7 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 6 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 22 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1</font></p> <p>still impresses me.&#160; Frankly I don't know how to comment that code to make it readable.&#160; In a real situation I would settle for a comment before the SELECT that stated:</p> <p>--Uses a table of numbers to parse the comma delimited list into a SQL acceptable format. <br />--If you don't understand this code, read this article: <a title="http://www.sommarskog.se/arrays-in-sql-2005.html#tblnum" href="http://www.sommarskog.se/arrays-in-sql-2005.html#tblnum">http://www.sommarskog.se/arrays-in-sql-2005.html#tblnum</a></p> <p>Opinions? What do you use for a comments in your code?&#160; Do you have commenting policies?</p><img src="http://sqlblog.com/aggbug.aspx?PostID=8132" width="1" height="1">Best PracticesDatabase DesignSQL ServerSQL Techniques2008: Error List in 2008http://sqlblog.com/blogs/louis_davidson/archive/2008/03/05/2008-error-list-in-2008.aspxThu, 06 Mar 2008 03:40:47 GMT21093a07-8b3d-42db-8cbf-3350fcbf5496:5474drsql4http://sqlblog.com/blogs/louis_davidson/comments/5474.aspxhttp://sqlblog.com/blogs/louis_davidson/commentrss.aspx?PostID=5474http://sqlblog.com/blogs/louis_davidson/rsscomments.aspx?PostID=5474<p>Ok, so I was looking around for a blurb about plan guides for my anti ad hoc SQL section of my book (ok, maybe not completely anti- but that isn't the point,) when I found this blog: <a title="http://geekswithblogs.net/Sreeblog/articles/117576.aspx" href="http://geekswithblogs.net/Sreeblog/articles/117576.aspx">http://geekswithblogs.net/Sreeblog/articles/117576.aspx</a> that basically just lists some new features in 2008.&nbsp; One that I hadn't seen I feel the need to mention.&nbsp; </p> <p>Transact-SQL Error List Window: <br>SQL Server Management Studio includes an Error List window that displays the syntax and semantic errors generated from the IntelliSense code in the Transact-SQL Query Editor. <p>If you haven't seen this, it is really kind of neat.&nbsp; Say you type: <p>select *<br>from sys.object<br>whe re name = 'fred' <p>You can see the obvious errors, since this is a very small batch, but IntelliSense underlines sys.object and re in the batch.&nbsp; Go to the View menu and show the Error List, and you will see something like this: <p><a href="http://sqlblog.com/blogs/louis_davidson/WindowsLiveWriter/2008ErrorListin2008_130DA/image_2.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="321" alt="image" src="http://sqlblog.com/blogs/louis_davidson/WindowsLiveWriter/2008ErrorListin2008_130DA/image_thumb.png" width="582" border="0"></a>&nbsp; <p>Double-click on the error, it takes you to the error in the query window.&nbsp; Obviously I have just discovered this, so please comment if you know more about this topic (particularly if it has been helpful to you or not) please chime in.&nbsp; And thanks to Sreenivas Mogullapalli for the cool post, it had a few other things I didn't remember too (just don't make me have to pronounce your name...I am pretty sure I wouldn't get it right.) <img src="http://sqlblog.com/aggbug.aspx?PostID=5474" width="1" height="1">SQL ServerSQL ToolsSSMS