• johncyriac:

    Nice. I added a line to see to what level nesting it did:

    create proc nest_sp_dec

    @kount int

    as

    begin

    select @kount

    select @kount=@kount-1

    SELECT @@NESTLEVEL AS NESTLEVEL

    if @kount >0

    exec nest_sp_dec @kount

    end

    and executed it with:

    nest_sp_dec 10

    It showed a nest level of 10

    and then with

    nest_sp_dec 33

    which exceeded the max nest level.

    Robert W. Marda

    SQL Programmer

    bigdough.com

    The world’s leading capital markets contact database and software platform.

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems