Calling one stored procedure within another stored procedure in sql

In this article we will learn how to call one stored procedure within another stored procedure in sql. Its quite easier and you don't have to bear any pain to do this. Lets have a look into example given below
declare @studentid bigint
declare @studentname varchar(50) 
set @studentid=20832083
exec @studentname = Web_Proc_GetStudentName @studentid -- use comma to separate multiple parameters 
exec @studentname = Web_Proc_GetStudentName @studentid

The above mentioned line of code is assigning return value of a stored procedure to @studentname variable. So folks that's it. Hope so this article will be proved handy for you.

Stay tuned for more useful tutorials.

0 comments: