At 02:33 PM 2/11/2003 -0500, you wrote:
>Are you suggesting that I run two queries within the cfquery tag?

I guess you're looking at that "select" as a second query? I hadn't really 
considered it that way.

Just run whatever query that normally you would run, then outside of it, 
try and get the ID of the new record you inserted... use that where I put 
(query syntax).

For example... here's one I use, trimmed out a bit:

<cfquery name="qryNewID" datasource="*** my datasource ***">
         set nocount on

         INSERT INTO TCustomField(***my fields ***)
         VALUES(*** my values ***)

         select NewID = @@IDENTITY
         set nocount off
</cfquery>
<cfset SomeVariable = qryNewID.NewID>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to