Dave - the mental model does not submit the entire transaction to the DB until the stack is built but I don't think that can be entirely correct either.

Bill - SQL reference manual has a discussion on @@identity vs SCOPE_IDENTITY(). Also several articles are around on the topic. SCOPE_IDENTITY() is more accurate. "@@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value only within the current scope; @@IDENTITY is not limited to a specific scope. "


At 12:39 PM 6/13/2005, you wrote:
Joe,

Just an FYI you can do, what I think your trying to do in your example of two queries as follows:



<cfquery name="qtContact_INS" datasource="#Arguments.DSN#" >
      SET NOCOUNT ON

      INSERT INTO dbo.tContact
           (
           [ContactTypesID],
           [StatusID],
           [TimeZoneID]
           )
           VALUES
           (
<cfqueryparam value="#theParams.$ContactTypesID#" cfsqltype="CF_SQL_smallint" >, <cfqueryparam value="#theParams.$StatusID#" cfsqltype="CF_SQL_smallint" >, <cfqueryparam value="#theParams.$TimeZoneID#" cfsqltype="CF_SQL_smallint" >
           )

        SELECT @@identity AS id
        SET NOCOUNT OFF
</cfquery>


Bill
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

-----------------------------------------------------------------------
http://www.switch-box.org/CFSQLTool/Download/

Switch_box                      MediaFirm, Inc.
www.Switch-box.org              Loveland, CO  USA



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to