I need to provide statistics on how many lines of code (LOC) associated with a system. The application part is easy but I need to also include any code residing within the SQL Server database. This would apply to stored procedures, functions, triggers, etc.
How can I easily get that info? Can it be done (accurately) with TSQL by querying the system tables\sprocs, etc?