• The first statement is very close to what SQL Server generates when you script a procedure, except that the last condition in the WHERE clause is

    [font="Courier New"] and OBJECTPROPERTY(id, N'IsProcedure') = 1)[/font]

    instead of

    [font="Courier New"]and type = 'P'[/font]

    I was just using this statement out of habit, did not think of doing it in a simpler way, such as yours. Nice one.

    I love this forum, learning something new everyday.