Counting lines of code of Stored Procedures in SQL Server 2005

Using SQL Server 2005 management studio, I have exported each Sprocs and Functions as a separate .sql file.

Is there a way that using CLOC tool, I can produce lines of code metric?

  • Does word alignment matter for keys?
  • Create delimited string from a row in stored procedure with unknown number of elements
  • Stored procedure that exports data into csv files only exports to one file
  • SQL Query Assistance
  • Insert results of a stored procedure into a temporary table
  • Is checking for primary key value before insert faster than using try-catch?
  • The CLOC site states that it supports SQL but it does not generate any metric in this case.



    3 Solutions collect form web for “Counting lines of code of Stored Procedures in SQL Server 2005”

    I got a tool that satisfies my requirement:

    If anything better, pl share it.



    Might this be of help: How do I calculate the SIZE of stored procedures in SQL Server 2005?

    WHy don’t you use “Generate Scripts” by rightlciking on your database in Management studio, selecting your tables/stored procs/functions, and then exporting it to one giant file.
    From that, you can use a tool like notepad++ (or even notepad if u take word wrap off and status bar on), to see number of lines.
    or you can use CLOC on this one file created. Which ever makes you happy.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.