If you're using SQL Server, it's not always good practice to use @@IDENTITY. Instead, use SCOPE_IDENTITY(). SCOPE_IDENTITY() is the same as @@IDENTITY, except it limits the scope. For example, if you insert a row into TableA, but that table has an insert trigger that does some processing and inserts into another table called TableB, you'll pull the ID for TableB. SCOPE_IDENTITY() always pulls the most recent identity within scope for the current session, which means you don't need to worry about triggers.
Granted, not a lot of people use triggers, but it's still good practice. Also, SCOPE_IDENTITY() may have been recently added. It may be a SQL Server 2000 feature so if you're using anything prior, you may be out of luck. Anybody else know if this is new to SQL Server 2000? Ben Johnson Hostworks, Inc. ______________________________________________________________________ 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

