Stored Procedure Nesting


You can also nest stored procedures like triggers. SQL Server 2005 supports up to 32 levels of stored procedures. If you exceed this level in a nest, the entire procedure cascade might collapse, depending on your code. You can check the nest level in any stored procedure by calling the @@NESTLEVEL function. This function returns the current nest level of the stored procedure the function was called from.

Despite the nest limit of 32, you can also spawn as many stored procedures as you want from within the nest chain or cascade. The called procedure does not increment the nest level counter as long as it completes without spawning another stored procedure.




Microsoft SQL Server 2005. The Complete Reference
Microsoft SQL Server 2005: The Complete Reference: Full Coverage of all New and Improved Features
ISBN: 0072261528
EAN: 2147483647
Year: 2006
Pages: 239

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net