Complements of Fusium.com!

<copy&paste>

<cfquery name="insert" datasource="DSN">
   set nocount on
   insert into customer (firstName, lastName)
   values
   ('#attributes.firstName#', '#attributes.LastName#')
   select @@identity as newID
   set nocount off
</cfquery>

I am the new primary key value:
<cfoutput>#insert.newID#</cfoutput>

</copy&paste>

Greg Hamm
Partner
Coreillia Development
[EMAIL PROTECTED]
http://www.coreillia.com



-----Original Message-----
From: Jeff [mailto:[EMAIL PROTECTED] 
Sent: July 8, 2003 11:20 AM
To: CF-Talk
Subject: I know you can do this...but I always forget how...

I'm using SQL Server, and I'm performing a cfquery and inserting
something,
then going to another, "success" page and I'd like to pass the ID of the
inserted item to the page, but I'm spacing how to do it...

Kinda like...

<cfquery...insert stuff>
</cfquery>

<cflocation url=success_page.cfm?ID=#ItemIJustInserted#>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

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

Reply via email to