I want a query that returns a list of all the (user) stored procedures in a database by name, with the number of lines of code for each one.
i.e.
sp_name lines_of_code
-------- -------------
DoStuff1 120
DoStuff2 50
DoStuff3 30
Any ideas how to do this?
This works for MS-SQL 2000
Edited so it should also now work in SQL Server 2000- 2008 and to exclude Database Diagram-related sprocs and funcs (which appear like user created objects).
FWIW, here's another one: