<cftransaction>

        <cfquery name="insertBlah" datasource etc>
                INSERT INTO tblBlah
                (name, address)
                VALUES
                ('Bill', 'Somewhere Street')
        </cfquery>
                
        <cfquery name="getIdentity" datasource etc>
                SELECT @@Identity as blahID
        </cfquery>

</cftransaction>

Then you use it in your code:

        getIdentity.blahID

etc.

HTH

- J

> -----Original Message-----
> From: Yorke Hinds [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 18 March 2004 10:39 AM
> To: CFAussie Mailing List
> Subject: [cfaussie] New Record - SELECT @@IDENTITY
> 
> 
> Not having used the SELECT @@IDENTITY regularly,
> I was wonder if anyone can shed some light on this method
> of retrieve the Record ID on INSERT.
> DB: Ms SQLServer 2000
> 
> All comments & insight welcome!
> 
> 
> 
> ---
> You are currently subscribed to cfaussie as: 
> [EMAIL PROTECTED]
> To unsubscribe send a blank email to 
> [EMAIL PROTECTED]
> 
> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
> http://www.mxdu.com/ + 24-25 February, 2004
> 

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to