SQL Server Articles

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


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

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 :


Return type of @@NESTLEVEL function is integer.

Examples of @@NESTLEVEL Function :

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



Above example returns current nesting level of stored procedure.


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!