Again this is for SQL server. Remeber that if you want to trap the id of
the record that was inserted or updated from within a trigger (using SQL)
you can query a table called INSERTED. It will be of identical structure to
the table affected and hold all the records affeted by the SQL statement.
You can only do this from within triggers
------------------------------------------------------------------
Andrew Ewings
Project Manager
Thoughtbubble Ltd
http://www.thoughtbubble.net
------------------------------------------------------------------
United Kingdom
http://www.thoughtbubble.co.uk/
Tel: +44 (0) 20 7387 8890
------------------------------------------------------------------
New Zealand
http://www.thoughtbubble.co.nz/
Tel: +64 (0) 9 488 9131
------------------------------------------------------------------
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s). Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0)207 387 8890.
-----Original Message-----
From: Joe Sheble aka Wizaerd [mailto:[EMAIL PROTECTED]]
Sent: 05 April 2001 15:54
To: CF-Talk
Subject: RE: update
There was an interesting answer to this type of question in Mid-March... I
hadn't tried it myself, and would be curious if anyone else has...
<CFQUERY ... cfquery parameters ...>
SET NOCOUNT ON
INSERT INTO SomeTable( SomeField ) VALUES( 'SomeValue' )
SELECT nNewID = @@IDENTITY
SET NOCOUNT OFF
</CFQUERY>
<CFOUTPUT>#qQueryVariable.nNewID#</CFOUTPUT>
At 03:09 PM 4/5/01 +0100, Bill Davies wrote:
>Becky see http://www.allaire.com/Handlers/index.cfm?ID=1463&Method=Full
>
>-----Original Message-----
>From: Jones, Becky [mailto:[EMAIL PROTECTED]]
>Sent: 05 April 2001 15:02
>To: CF-Talk
>Subject: update
>
>
>is there anyway to output the last primary key number in a table after an
>insert statement?
>i need to capture that number on the same action page so i can pass it to
>another table.
>in other words, on my insertApp.cfm i have the query to update my apps
>table.
>but on this same page at the bottom, i have another form...a form to update
>the licensing. when i submit this form, i need that primary key from my
>apps table to pass thru to my licensing table.
>so i need a way to capture that value.
>any ideas?
>
>
>*************************************************
>This e-mail, including any attachments, is intended for the
>receipt and use by the intended addressee(s), and may contain
>confidential and privileged information. If you are not an intended
>recipient of this e-mail, you are hereby notified that any unauthorized
>use or distribution of this e-mail is strictly prohibited.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists