Thursday, 13 November 2014

Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)

When you execute your procedure in your database then a very common error of MSSQL "Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)."
comes often.
Solution to this problem is when you execute your procedure then then use keyword 'Go' between final 'end' and exec procedure
Like
ALTER procedure [dbo].[test]
(
@a nvarchar(50),
@b nvarchar(50)
)
as
 declare @id int
 declare @Aid2 int 
 declare @counter int
    begin
                    select 1
      end
    go  

exec test 'starplus','starplus7'

This will solve your problem.......