<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dutton Software &#187; T-SQL</title>
	<atom:link href="http://www.duttonsoftware.com/category/t-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.duttonsoftware.com</link>
	<description>Code, plug-ins &#38; more</description>
	<lastBuildDate>Fri, 05 Mar 2010 17:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>T-SQL missing comma in SELECT does not generate parsing error</title>
		<link>http://www.duttonsoftware.com/2008/10/22/t-sql-missing-comma-in-select-does-not-generate-parsing-error/</link>
		<comments>http://www.duttonsoftware.com/2008/10/22/t-sql-missing-comma-in-select-does-not-generate-parsing-error/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 05:34:24 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.duttonsoftware.com/?p=84</guid>
		<description><![CDATA[I ran in to this &#8220;gotcha&#8221; the other day while writing a number of views. I omitted a comma on my SELECT statement, and the parser did not return an error, but rather just results that I did not expect. The problem is that SQL Server interprets the missing comma as an implied column name. [...]]]></description>
			<content:encoded><![CDATA[<p>I ran in to this &#8220;gotcha&#8221; the other day while writing a number of views. I omitted a comma on my SELECT statement, and the parser did not return an error, but rather just results that I did not expect. The problem is that SQL Server interprets the missing comma as an implied column name. It is as if there is an unwritten &#8220;AS&#8221; where the missing comma should go.</p>
<p>Screenshots of the three scenarios:</p>
<div id="attachment_85" class="wp-caption alignnone" style="width: 484px"><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/10/desired-query-with-correct-syntax.jpg"><img class="size-full wp-image-85" title="desired-query-with-correct-syntax" src="http://www.duttonsoftware.com/wp-content/uploads/2008/10/desired-query-with-correct-syntax.jpg" alt="Desired query with the correct syntax" width="474" height="182" /></a><p class="wp-caption-text">The correct query returns the desired results: two columns of information</p></div>
<div id="attachment_86" class="wp-caption alignnone" style="width: 505px"><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/10/accidentially-left-off-the-comma-only-one-column-returned.jpg"><img class="size-full wp-image-86" title="accidentially-left-off-the-comma-only-one-column-returned" src="http://www.duttonsoftware.com/wp-content/uploads/2008/10/accidentially-left-off-the-comma-only-one-column-returned.jpg" alt="Accidentially leaving off the comma results in only one column (with the wrong data)" width="495" height="181" /></a><p class="wp-caption-text">Accidentally leaving off the comma results in only one column (with the wrong data)</p></div>
<div id="attachment_87" class="wp-caption alignnone" style="width: 474px"><a href="http://www.duttonsoftware.com/wp-content/uploads/2008/10/explicit-as-same-results-as-omitting-comma.jpg"><img class="size-full wp-image-87" title="explicit-has-same-results-as-omitting-comma" src="http://www.duttonsoftware.com/wp-content/uploads/2008/10/explicit-as-same-results-as-omitting-comma.jpg" alt="Adding in an explicit &quot;AS&quot; gives the same results as omitting the comma" width="464" height="184" /></a><p class="wp-caption-text">Adding in an explicit &quot;AS&quot; gives the same results as omitting the comma</p></div>
<p>I&#8217;ve been working with SQL for years and never had this issue before. I supposed it is because if I make a mistake like this, I usually omit more than one comma, which causes a parsing error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.duttonsoftware.com/2008/10/22/t-sql-missing-comma-in-select-does-not-generate-parsing-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
