Created
April 22, 2014 08:09
-
-
Save andrijac/11169569 to your computer and use it in GitHub Desktop.
Find line count in SQL server stored procedures.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT o.type_desc AS ROUTINE_TYPE | |
,QUOTENAME(s.[name]) + '.' + QUOTENAME(o.[name]) AS [OBJECT_NAME] | |
,(LEN(m.definition) - LEN(REPLACE(m.definition, CHAR(10), ''))) AS LINES_OF_CODE | |
FROM sys.sql_modules AS m | |
INNER JOIN sys.objects AS o | |
ON m.[object_id] = o.[OBJECT_ID] | |
INNER JOIN sys.schemas AS s | |
ON s.[schema_id] = o.[schema_id] | |
order by LINES_OF_CODE desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment