Kris,
In your Stored Proc you can use one of SQL's own variables @@identity to get
the row id for the record you have just inserted.  Simply assign @@identity
to a local var et voil�!

HTH
Stephen

DECLARE @id as int

INSERT INTO tableFoo (Col1,Col2,Col3)
VALUES (a,b,c)

SELECT @@identity = @id
SELECT @id


-----Original Message-----
From: Kris Pilles [mailto:[EMAIL PROTECTED]]
Sent: 21 May 2002 14:06
To: CF-Talk
Subject: Query help


How can Insert a record into a table (that I know how to do) but after
the insert, I want to be able to know what the primary key for the
record I just inserted...  

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.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

Reply via email to