can i write function in stored procedure and stored
procedure in function and nested procedure.Give one example
for each question?



can i write function in stored procedure and stored procedure in function and nested procedure.Give..

Answer / dba

You cannot define stored procedures (SP) or user-define
functions (UDF) in a nested fashion. However, you can
execute SPs and UDFs inside of stored procedures. The
nesting is limited to 32 levels deep (A calls B, which calls
C, etc). So if a recursive call is used (A calls A), you
must have some method of stopping before 32 levels is exceeded.

You can call SPs and UDFs from inside of a UDF, but this
ability is quite limited. If a SP has any side effect, it
cannot be called. So, the SP cannot be used to return any
values to the function.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More SQL Server Interview Questions

Determine when to use stored procedure to complete sql server tasks?

0 Answers  


How do you use a subquery to find records that exist in one table and do not exist in another?

0 Answers  


What is the template in sql?

0 Answers  


How can we delete a table in sql server?

0 Answers  


Do you know the cursor types?

0 Answers  






What is an active database?

0 Answers   HCL,


PC(code, model, speed, ram, hd, cd, price) Find the hard drive sizes that are equal among two or more PCs.

6 Answers   APX,


How to insert data with null values?

0 Answers  


How to edit table in sql server 2017?

0 Answers  


About DTS usage ?

2 Answers   Cognizant, Wipro,


What is a rownum?

0 Answers  


What are distinctive joins find as a part of sql?

0 Answers  


Categories