Store procedure Inside Store procedure [Resolved]

Posted by Patel28rajendra under ASP.NET on 3/26/2012 | Points: 10 | Views : 1269 | Status : [Member] | Replies : 11
Hi

can anyone tell me

Can we call one store procedure from another store procedure.


Thanks

R D Patel


Responses

Posted by: Balajikcp8 on: 3/26/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
yes we can...

create procedure first @i int output
as begin
select @i=(select id from student)
end


create procedure second
as
begin
declare @i int
exec first @i output
select id, sname from student_name where id in(select @i)
end

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/26/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi Patel28rajendra

we can execute store procedure in another store procedure...

create procedure procedure_name

@id
as
Begin

Exec another_procedurename @id

ur new procedure operation

End


Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/26/2012 [Member] Bronze | Points: 25

Up
0
Down


Hi Patel28rajendra

http://stackoverflow.com/questions/2945195/dynamically-call-a-stored-procedure-from-another-stored-procedure

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/26/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

Sabari Mahesh

Thanks for your reply but if you have any other link then please post so i can get clear idea about it.




R D Patel

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/26/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Patel Rajendra ,
Refer to this:
http://stackoverflow.com/questions/170328/executing-a-stored-procedure-within-a-stored-procedure

Thanks,
Sanjay

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/26/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Mr.Patel Rajendra,
Another good example is here:
http://www.aspfree.com/c/a/ASP.NET-Code/Call-Stored-procedure-from-within-another-stored-procedure-return-values/

Thanks,
Sanjay

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/26/2012 [Member] Bronze | Points: 25

Up
0
Down
hi Patel28rajendra
Ya .... Sure

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/26/2012 [Member] Bronze | Points: 25

Up
0
Down
Balajikcp8

Yes Correct

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/26/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks To all for reply


R D Patel

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/26/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Balaji,
Its simple and informative, thanks

Thanks,
Sanjay

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 3/27/2012 [Member] Bronze | Points: 25

Up
0
Down
Patel28rajendra

Again A Welcome Man

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response