Yes so you are doing two things to the DB within one query? Thanks,
Neil ----- Original Message ----- From: "Scott Weikert" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 3:08 PM Subject: Re: @@identity and serilizatoin errors. > 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 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

