canb we write function in stored procedure in sql

Posted by Shanky11 under Sql Server on 2/14/2013 | Points: 10 | Views : 2563 | Status : [Member] | Replies : 6
canb we write function in stored procedure in sql?????




Responses

Posted by: Pandians on: 2/15/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Do you want to CREATE a Function in stored procedure ? If so...
Create Proc Proc1

As
Begin
EXEC('Create Function Func1() Returns Int
As
Begin
Return 100
End')
End
GO


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

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

Posted by: Arul44ece on: 2/15/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Friend

We can call a function inside the stored procedure

Regards,

Arul R
arul44.ece@gmail.com

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

Posted by: Shanky11 on: 2/15/2013 [Member] Starter | Points: 25

Up
0
Down
and what about calling sp inside functon

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

Posted by: Pandians on: 2/15/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
YES. You can also call a Procedure inside the Function!

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

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

Posted by: Shanky11 on: 2/15/2013 [Member] Starter | Points: 25

Up
0
Down
procedure doesnt return value then how can we cal a procedure inside function
to call a procedure we have ti call it explicitly

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

Posted by: Muhsinathk on: 3/14/2013 [Member] Bronze | Points: 25

Up
0
Down
We can call a function inside a stored procedure but we can not call a store procedure inside a function.

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

Login to post response