<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>My mostly ColdFusion Blog, with some other stuff thrown in - SQL</title>
			<link>http://blog.garthe.com/index.cfm</link>
			<description>My random findings during 13 years of using the best programming language in the world.</description>
			<language>en-us</language>
			<pubDate>Fri, 03 Sep 2010 19:08:23-0500</pubDate>
			<lastBuildDate>Fri, 26 Oct 2007 15:33:00-0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>davidgarthe@gmail.com</managingEditor>
			<webMaster>davidgarthe@gmail.com</webMaster>
			
			
			
			
			
			<item>
				<title>Coldfusion query of queries with a reserved word in SQL</title>
				<link>http://blog.garthe.com/index.cfm/2007/10/26/Coldfusion-query-of-queries-with-a-reserved-word-in-SQL</link>
				<description>
				
				My client has a stored procedure that was returning a column named &quot;level&quot;.  While trying to execute a query of queries on the resultset, I ran into some issues because &quot;Level&quot; is a reserved word in T-SQL.  The stored proc simply returns a column aliased as &quot;level&quot;.  Its not actually that in the table, so this problem wasn&apos;t an issue previously.

I was going to change the stored procedure itself, but other applications rely on the naming structure already in place.  Any change would be a pain.

I was able to work with the query of queries by putting brackets around my reserved word column.  Now ColdFusion and Sql are quite happy!

&lt;code&gt;
&lt;cfquery dbtype=&quot;query&quot; name=&quot;shortenedQuery&quot;&gt;
	SELECT categoryName, [level], name
	FROM queryResults
&lt;/cfquery&gt;
&lt;/code&gt;
				
				</description>
						
				
				<category>coldFusion</category>				
				
				<category>SQL</category>				
				
				<pubDate>Fri, 26 Oct 2007 15:33:00-0500</pubDate>
				<guid>http://blog.garthe.com/index.cfm/2007/10/26/Coldfusion-query-of-queries-with-a-reserved-word-in-SQL</guid>
				
			</item>
			
		 	
			</channel></rss>