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 |
|
yossibaram
Yak Posting Veteran
82 Posts |
Posted - 2002-08-13 : 09:08:00
|
| Hi,I would like to call SP(1) within SP(2).SP(1) returns a parameter and I would like SP(2) to send this Parameter to SP(3).Its sounds complicated but guess its not.I'm green with Stored procedures and if you know of a link with good examples write it down.ThanksYossi |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-08-13 : 09:12:49
|
| create procedure sp2asdeclare @i int, @rc intexec @rc = sp1 @i outputif @@eror <> 0 or @rc <> 0 returnexec sp3 @igocreate procedure sp1@i int outputas...select @i = ...go==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.Edited by - nr on 08/13/2002 09:13:12 |
 |
|
|
yossibaram
Yak Posting Veteran
82 Posts |
Posted - 2002-08-13 : 10:18:12
|
| nr,Thanks a lot for the quick reply.I need SP(1) only to send a parameter without getting any (can i?).Thanks againYossi |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-08-13 : 10:22:47
|
| Output parameters are always input also but the sp doesn't have to use the input.There is a return code but that is usually used for error codes only and is restricted to an int.If you don't want the sp to have a parameter at all then you will have to add an entry to a table keyed on the spid for the calling SP to retrieve. SP parameters are much simpler.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|