May 5, 2006 at 4:57 am
HI
Is it possible to call procedure|function in the same procedure|function itself..
May 5, 2006 at 5:22 am
yes you can
but it will usually end in someone crying
the sql server will also protect it from executing endlessley and will stop it at the nesting level set on your server - a default of 32
you can test it as follows
create proc test as
print 'hello'
exec test
GO
you'll get the message
Cannot add rows to sysdepends for the current stored procedure because it depends on the missing object 'test'. The stored procedure will still be created.
but the proc is created
then call the proc using exec TEST - you'll get
Server: Msg 217, Level 16, State 1, Procedure test, Line 3
Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).
hello
hello
hello
hello
hello
hello
hello
MVDBA
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply