Logo 
Search:

SQL Server Articles

Submit Article
Home » Articles » SQL Server » Configuration FunctionsRSS Feeds

@@NESTLEVEL - NESTLEVEL Function

Posted By: Sarita Patel     Category: SQL Server     Views: 2422

This article explains about @@NESTLEVEL function in sql server with examples.

@@NESTLEVEL function is used to get nesting level of the current stored procedure execution. Each time a stored procedure calls another stored procedure, the nesting level is incremented. When the maximum of 32 is exceeded, the transaction is terminated. 


Syntax of @@NESTLEVEL Function :

@@NESTLEVEL

Return type of @@NESTLEVEL function is integer.



Examples of @@NESTLEVEL Function :

Example 1 : Use of @@NESTLEVEL function in select clause

SELECT @@NESTLEVEL

Output
0

Above example returns current nesting level of stored procedure.
  
Share: 

 
 

Didn't find what you were looking for? Find more on @@NESTLEVEL - NESTLEVEL Function Or get search suggestion and latest updates.

Sarita Patel
Sarita Patel author of @@NESTLEVEL - NESTLEVEL Function is from United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!