Barclays Interview Questions | Recursion

Question

Can a stored procedure call itself or recursive stored procedure? How many level SP nesting possible?

in progress 0
Dhruv2301 4 years 1 Answer 747 views Great Grand Master 0

Answer ( 1 )

  1. Yes. Because Transact-SQL supports recursion, you can write stored procedures that call themselves.

    A common application of recursive logic is to perform numeric computations that lend themselves to repetitive evaluation by the same processing steps. Stored procedures are nested when one stored procedure calls another or executes managed code by referencing a CLR routine, type, or aggregate. You can nest stored procedures and managed code references up to 32 levels.

Leave an answer

Browse
Browse