<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>ColdFusion Muse - Coldfusion &amp;amp; Databases</title>
			<link>http://www.coldfusionmuse.com/index.cfm</link>
			<description>Musings and Other Things from CF Guru Mark Kruger</description>
			<language>en-us</language>
			<pubDate>Thu, 02 Sep 2010 20:15:29 -0500</pubDate>
			<lastBuildDate>Thu, 23 Jul 2009 17:41:00 -0500</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>mkruger@cfwebtools.com</managingEditor>
			<webMaster>mkruger@cfwebtools.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>mkruger@cfwebtools.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>ColdFusion Muse</title>
				<link>http://www.coldfusionmuse.com/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>Data Truncation Error: Migrating MySQL to MSSQL</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2009/7/23/data.truncation.mysql.to.mssql</link>
				<description>
				
				&lt;p&gt;
	I have one more tip as a follow up to my previous post on &lt;a href=&quot;http://www.coldfusionmuse.com/index.cfm/2009/7/13/MySQL.to.MSSQL&quot;&gt;Migrating Between MySQL and MSSQL&lt;/a&gt;. It has to do with the dreaded &quot;data trunction error&quot;. If you have used MSSQL you may have seen this error crop up from time to time. It is a common error and very easy to remedy. The error occurs when you have a character field with a length that is too short for the size of the string you are trying to insert. Check out this example.... 
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Thu, 23 Jul 2009 17:41:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2009/7/23/data.truncation.mysql.to.mssql</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Migrating Between MySQL to MSSQL</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2009/7/13/MySQL.to.MSSQL</link>
				<description>
				
				&lt;h4&gt;&lt;/h4&gt;
&lt;p&gt;
	I recently did an emergency stint of troubleshooting for a site owner (a designer who owned a complex ColdFusion site) who was hit with the HTML injection issue on his site. He had done a good deal of work on his own and cleaned up the HTML as best he could. He was busy moving the sites to a more secure environment (a better hosting company, no more FTP, intrusion detection and solid VPN support).  He had managed to travel a long way down the migration path before he ran into trouble. His new environment used MSSQL and his old environment used MySQL. 
&lt;/p&gt;
&lt;p&gt;
Now I love MSSQL and I think it is a wonderful choice (price notwithstanding), but had he contacted me before he decided to go this route I would have suggested that he stick with MySQL for the sake of compatibility. Unfortunately he had already &quot;flipped the switch&quot; before I got there and so there was a lot of &quot;on the fly&quot; changes to make just to get his site working correctly again. One of the biggest issues had to do with his choice for migrating the actual data. He had chosen to use an export tool to move the MySQL data into an Microsoft Access file. He then used Microsoft Access &quot;upsize&quot; wizard to send the data to the MSSQL server. The biggest flaw with this approach is that it resulted in missing dates which were not translated correctly from MySQL to Access to MSSQL. So we had to re-export the data in to SQL dumps, modify them and then run them against MSSQL. 
&lt;/p&gt;
&lt;p&gt;
	The date problem is not a typical incompatibility with MSSQL, but there &lt;em&gt;are&lt;/em&gt; several we ran into that we had to account for. Here they are in random order:
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Mon, 13 Jul 2009 18:02:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2009/7/13/MySQL.to.MSSQL</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Tabular Data Stream Error (Who&apos;s Using a Cursor Select Method?)</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2008/8/14/Tabular-data-stream-error</link>
				<description>
				
				&lt;p&gt;
	It&apos;s not often I see an error that I have simply never seen before. Here&apos;s one that some of you may recognize. It happened on a query using SELECT * against a fairly limited table on an MSSQL 2005 database. There wasn&apos;t anything unusual about the query (except for the bad form of using the asterisk). Here&apos;s the error that was thrown:
&lt;/p&gt;
&lt;code&gt;
rror Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]
The incoming tabular data stream (TDS) remote procedure call (RPC) protocol 
stream is incorrect. 
Parameter 2 (&quot;&quot;&quot;&quot;): Data type 0x38 is unknown. 
The specific sequence of files included or processed is: ****** 
&lt;/code&gt;
&lt;h4&gt;The Fix&lt;/h4&gt;
				 [More]
				</description>
						
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Thu, 14 Aug 2008 14:27:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2008/8/14/Tabular-data-stream-error</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Migrating to MSSQL 2005 and UNION Queries</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2008/7/18/Migrate-to-mssql2005-and-UNION</link>
				<description>
				
				&lt;p&gt;
	For the most part, migrating your ColdFusion site from Microsoft&apos;s SQL 2000 server to SQL 2005 is a snap. Import the databases from 2000 to 2005, re-point your data sources to the new instance using the ColdFusion Administrator and you are done. No muss, no fuss. There is very little query code that you will need to change. Sometimes you needn&apos;t change anything in your ColdFusion code at all. Here is one that I found recently however that you &lt;em&gt;may&lt;/em&gt; run across - especially if you are a fan of &lt;a href=&quot;http://www.coldfusionmuse.com/index.cfm/2005/7/25/union%20queries&quot;&gt;UNION&lt;/a&gt; queries. Here&apos;s the skinny.
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Fri, 18 Jul 2008 10:51:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2008/7/18/Migrate-to-mssql2005-and-UNION</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Ask-a-muse: Proper Use of Cachedafter</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2008/3/18/cachedafter</link>
				<description>
				
				&lt;div style=&quot;margin-left: 20px; border-left: 3px solid #CCCCCC; padding-left: 4px;&quot;&gt;
&lt;p&gt;&lt;em&gt;Muse Reader Asks:&lt;/em&gt;&lt;br&gt;
	I&apos;m trying to use &lt;em&gt;cachedAfter&lt;/em&gt; in a query. I have tried cachedAfter=&quot;#dateAdd(&quot;d&quot;, 1, now())# but it doesn&apos;t seem to ever cache after a day has passed. What am I doing wrong? &lt;em&gt;cachedwithin&lt;/em&gt; seems to work fine.
&lt;/p&gt;
&lt;/div&gt;
&lt;p style=&quot;padding-top: 15px;&quot;&gt;
This is one of those obscure tags that gets very little use in the community. I confess to never actually having found a use for it in production. Still, it bears some looking at because it is a clever notion that might come in handy under certain circumstances. Here&apos;s a primer:
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Tue, 18 Mar 2008 17:43:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2008/3/18/cachedafter</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Coldfusion and Oracle 8i Performance</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2008/3/9/coldfusion.oracle.8i</link>
				<description>
				
				&lt;p&gt; 
	Recently I had the opportunity to work with a server setup that included two load balanced servers running Coldfusion 7 enterprise backstopped by a hefty Enterprise Oracle 8i server. The CF 7 servers were going down repeatedly. The database people blamed the web people who blamed the networking people who blamed the government. No one seemed to make any headway on the issue. I was engaged to get the CF 7 (and 2 CF 8 servers using a separate configuration) stable. I arrived on site with my change document in hand. I learned, or I was reminded of, a number of things during the experience that I will try to boil down into two or three posts - including:
&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Don&apos;t Accept the Default Settings&lt;/strong&gt; - It&apos;s surprising how many enterprise servers I run into that have been installed but left with the &quot;default settings&quot;. Naturally the default settings are simply inadequate to support any usage beyond the bare minimum.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Most Code Evolves Without Planning&lt;/strong&gt;&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Team Troubleshooting is Key&lt;/strong&gt; - When systems are highly complex, no one person will ever have all the necessary information to explore all the possible solutions. It takes bringing together folks from the various disciplines (networking, database, Coldfusion, Linux etc.) to really make it work.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;Big Oracle Tip&lt;/strong&gt; - This will be the topic of this post&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Sun, 09 Mar 2008 00:07:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2008/3/9/coldfusion.oracle.8i</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Creating Views With CF Query: DDL Follies</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2007/11/14/Coldfusion.MSSQL.Views</link>
				<description>
				
				&lt;p&gt; 	
	Most queries in your Coldfusion code do one of four things - Select, Insert, Update or Delete. Maybe you did &lt;em&gt;not&lt;/em&gt; know that, given the proper permissions, you can do just about anything that can be done on the DB server from within a query. You can backup and restore, drop users, even execute shell commands. That&apos;s why you should never create a datasource using the SA user. Instead you should define what you want a datasource to do and create a user for that purpose. Still, sometimes it is useful to be able to do &lt;em&gt;other&lt;/em&gt; things using Coldfusion and Cfquery. 
&lt;/p&gt;
&lt;p&gt;
	For example, I have a generic table with rows that look like &quot;col1, col2&quot; that holds form data. In this particular application the customer creates custom forms to collect data from specific clients. All the forms look different. One might have fullname, address, city, Postal code, and the next one might see first name, last name zip. When the data is submitted it is put in col1, col2, col3. But he has a reporting tool that allows him to query tables from the database and run reports for his customer. What can we do to make it easier for him to report? Surely &quot;select col1, col2&quot; isn&apos;t going to do it. The answer is to use T-SQL Data Definition Language (DDL) to create a view for each customer.
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Wed, 14 Nov 2007 19:35:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2007/11/14/Coldfusion.MSSQL.Views</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Using Rowcount in T-SQL</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2007/9/7/tsql.rowcount</link>
				<description>
				
				&lt;p&gt;
	Here&apos;s a tip for limiting the number of rows returned from a query. Now I know you think &quot;that&apos;s easy - just use &lt;em&gt;TOP&lt;/em&gt;.&quot; Ah... but what if TOP is not an option? Consider this example. You have a reporting stored procedure that you want to use to return multiple results sets to your Coldfusion Page. Easy - right?
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Fri, 07 Sep 2007 13:45:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2007/9/7/tsql.rowcount</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Handling Variable Form Data in a Stored Procedure</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2007/8/13/stored.procedure.form.data</link>
				<description>
				
				&lt;p&gt;
	Lots of projects have a requirement that interaction with a database must be done using stored procedures only. Stored procedures are generally quite easy to write, but there are some things that are slightly more difficult that using a straight CFQUERY.  For example, perhaps you have seen code that handles a search form. You might see a query that looks something like this:
&lt;code&gt;
&lt;cfquery name=&quot;get&quot; datasource=&quot;#dsn#&quot;&gt;
	SELECT * FROM USERS 
	WHERE	userID IS NOT NULL
	
	&lt;cfif NOT isEmpty(form.username)&gt;
		AND UserName = &apos;#form.username#&apos;
	&lt;/cfif&gt;
	&lt;cfif NOT isEmpty(form.address)&gt;
		AND Address = &apos;#form.address#&apos;
	&lt;/cfif&gt;	
&lt;/cfquery&gt;
&lt;/code&gt;
Please note, I&apos;m use a UDF called &quot;isEmpty&quot; that simply trims the string and checks the length. Also keep in mind that I&apos;m not adding the required Cfqueryparam to save room. How would you duplicate this code in a T-SQL stored procedure?
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Mon, 13 Aug 2007 21:49:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2007/8/13/stored.procedure.form.data</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>JDBC Drivers, Data Binding and Implicit Conversion</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2007/2/25/implicit.conversion</link>
				<description>
				
				&lt;p&gt; 
	You may know that MSSQL allows for &quot;implicit conversion&quot; between data types. For example if you have a character column and you pass it a number without single quotes (as in myCharCol = 1), MSSQL will automatically convert the value 1 into a character for the purpose of the query. On a Coldfusion 5 server this behavior carries through seamlessly even when you are binding data using cfqueryparam. However, if you are using cfqueryparam in a query on a CF 5 server and also relying on implicit conversion within the &lt;em&gt;same query&lt;/em&gt; you should know that you may have a problem getting that cfquery to work in Coldfusion MX. The issue is that JDBC &quot;prepares&quot; the statement by validating against the schema. Here&apos;s an example:
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>Coldfusion Upgrading</category>				
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Sun, 25 Feb 2007 00:13:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2007/2/25/implicit.conversion</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Cfqueryparam Fails When Using &quot;WHERE EXISTS&quot;</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2006/12/6/cfqueryparam.fails.where.exists</link>
				<description>
				
				&lt;p&gt;
	I have always been an advocate of &lt;em&gt;Cfqueryparam&lt;/em&gt;. Binding your variables innoculates you against SQL injection attack, often results in speed improvements and lessens the load on your database server. It may even help with the laundry (that&apos;s the word on the street). This morning I ran across an error that is produced by the &lt;em&gt;correct&lt;/em&gt; use of cfquery param. It has to do with using the clause &quot;WHERE EXISTS&quot; in your query. Here&apos;s the query in question.
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Wed, 06 Dec 2006 14:10:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2006/12/6/cfqueryparam.fails.where.exists</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Why You Should Join AA (Access Anonymous)</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2006/9/22/Access.Anonymous</link>
				<description>
				
				&lt;p&gt; 
	I&apos;m an Access hater too - so the idea of giving tips on it galls me just a bit. Recently, however, I had the opportunity to help a fellow with his Access driven Coldfusion site. This poor soul had moved his Coldfusion site from experthost.com to godaddy.com to save a few bucks. Saving money on hosting is almost never worth it in my opinion - but I won&apos;t go there for this post. After much heartache he got the Access DSN installed using the godaddy control panel. But, uh oh... the new Access driver is the one with Unicode support (at least that&apos;s what I surmise &lt;em&gt;without&lt;/em&gt; talking to the perky but useless godaddy support).  That means that lots of things are now broken. 
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>Coldfusion Troubleshooting</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Fri, 22 Sep 2006 13:43:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2006/9/22/Access.Anonymous</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>More CF and DTS Troubleshooting</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2006/8/25/cf.dts.troubleshooting</link>
				<description>
				
				&lt;p&gt;
	For those of you that have made use of my blog post on &lt;a href=&quot;http://mkruger.cfwebtools.com/index.cfm?mode=alias&amp;alias=cf.dts&quot;&gt;DTS and Coldfusion&lt;/a&gt; and the subsequent blog on &lt;a href=&quot;http://mkruger.cfwebtools.com/index.cfm?mode=alias&amp;alias=cf.dts.revised&quot;&gt;Troubleshooting DTS and Coldfusion&lt;/a&gt;, I have a 2 more useful tips. One has to do with a way to trap errors on the server and get information about what&apos;s going on on the client - the second tip has to do with protocol selection and conflict.
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Fri, 25 Aug 2006 15:55:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2006/8/25/cf.dts.troubleshooting</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Top and the UNION Query</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2006/8/25/union.top</link>
				<description>
				
				&lt;p&gt; 
	A &quot;UNION&quot; query can be very useful. Take sorting for example.  If I want to select 2 types of data from the same table using different conditions and order &lt;em&gt;by my conditions&lt;/em&gt; union is a great tool. See my previous post on &lt;a href=&quot;http://mkruger.cfwebtools.com/index.cfm?mode=alias&amp;alias=union%20queries&quot;&gt;Using UNION in your queries&lt;/a&gt;.  If you also like using TOP you may run into an unexpected behavior when using UNION.  Let&apos;s say you had 2 tables, portalUsers and intranetUsers and you wanted to get the most recent entries in each that were unapproved. If you try something like this:
&lt;div class=&quot;code&quot;&gt;&lt;FONT COLOR=MAROON&gt;&amp;lt;cfquery name=&lt;FONT COLOR=BLUE&gt;&quot;myquery&quot;&lt;/FONT&gt; datasource=&lt;FONT COLOR=BLUE&gt;&quot;mydsn&quot;&lt;/FONT&gt;&amp;gt;&lt;/FONT&gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT &amp;nbsp;&amp;nbsp;&amp;nbsp;TOP 1 fname, lname, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&apos;Portal&apos; AS sourceTable, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dateAdded&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM &amp;nbsp;&amp;nbsp;&amp;nbsp;portalUsers&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp;unApproved = 1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;UNION&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT TOP 1 fname, lname, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&apos;Intranet&apos; AS sourceTable, &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dateAdded&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;intranetUsers&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp;Approved = 0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;ORDER BY dateAdded&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&lt;FONT COLOR=MAROON&gt;&amp;lt;/cfquery&amp;gt;&lt;/FONT&gt;&lt;/div&gt;
You might expect to get 2 records equal to the most recently added portal user and the most recently added intranet user - right? You could take the first record and you would be good to go. Actually, unless the &quot;portalUsers&quot; table has a clustered index ordered by dateAdded, this is &lt;em&gt;not the case&lt;/em&gt;.
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Fri, 25 Aug 2006 09:10:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2006/8/25/union.top</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Inserting and Updating in a Single Query Statement</title>
				<link>http://www.coldfusionmuse.com/index.cfm/2006/6/23/insert.update.one.statement</link>
				<description>
				
				&lt;p&gt;
	This is a tip about something I do regularly. No, I&apos;m not talking about forgetting to put down the seat. I&apos;m talking about coding. Let&apos;s say you have an application that collects user data in a wizard-like format using a few steps. You allow folks to go back and forth between steps and edit what they&apos;ve done.  How do you handle the insert on that first step without creating duplicates when users return to that step? There are several approaches to this problem:
&lt;/p&gt;
				 [More]
				</description>
						
				
				<category>MS SQL Server</category>				
				
				<category>Coldfusion &amp;amp; Databases</category>				
				
				<pubDate>Fri, 23 Jun 2006 10:20:00 -0500</pubDate>
				<guid>http://www.coldfusionmuse.com/index.cfm/2006/6/23/insert.update.one.statement</guid>
				
				
			</item>
			
		 	
			</channel></rss>