Are you inserting data into a table which automatically creates an ID
(IDENTITY filed)?  If so what you want to do is perform the INSERT statement
in your SP and then immediately afterwards interrogate the INSERTED table.
This is a table which SQL automatically creates with exactly the same
structure as the table you are insering into when you are performing an
Insert or an Update and it contains all of the rows that you
inserted/updated.

So, if you are only inserting one row you want.....

INSERT INTO <tablename> (<filedlist>)
VALUES(<valuelist>)

SELECT @outputparam = ID FROM INSERTED

where @outputparam is your output parameter declared in the SP and in CF


-----Original Message-----
From: Neil H. [mailto:[EMAIL PROTECTED]]
Sent: 24 August 2000 15:15
To: [EMAIL PROTECTED]
Subject: Stored Procedure


I am trying to write a storedproc that does an insert and then returns a
value.  The problem is this, I pass in about 15 variable as Type="IN" in
cfprocparam.   Then I want one type="OUT" called UserID.  Anyway what do I
have to write in the Stored Proc itself to allow that to happen.

Thanks,

Neil

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to