Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Kappy
Starting Member
30 Posts |
Posted - 2001-12-03 : 16:07:36
|
| Hi-I am working on a procedure that uses a cursor to pass values to a sproc. The sproc that I am passing values to creates another value that I need. How do I get this value?Example:exec espIncident 1, --site id 0, --Incident Id 12345 --Customer IdThe incident Id is created as the procedure is run, and I need that value to continue the rest of my procedure.I hope I have explained this correctly...Thanks! |
|
|
efelito
Constraint Violating Yak Guru
478 Posts |
Posted - 2001-12-03 : 16:38:25
|
| You need to define the output variable as part of the procedure declaration.create procedure espIncident@invar int,@outvar int OUTPUTASselect @outvar = @invar * 2returnThen you can get the variable back when you run the procdeclare @espIncidentOutputexec espIncident 5, @espIncidentOutput OUTPUTselect @espIncidentOutputJeff BanschbachConsultant, MCDBAEdited by - efelito on 12/03/2001 16:38:48 |
 |
|
|
|
|
|