Yes, If you are doing this inside a single transaction (implicit or explicit) this variable will safely return the value of the identity field. If you are using CFquery, block the insert and select code into a single <cfquery> or if using two queries, use cf transaction.
Mark -----Original Message----- From: brook [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 5:52 PM To: CF-Talk Subject: SQL Server and NOCOUNT Hello, Is using the SET NOCOUNT ON and select newid=@@identity in a SQL statement a safe & reliable way to get the Newly inserted ID on a identity column? Brook ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

