Assuming that a carriage return represents a line of code, this will count the lines of code in a SQL 2008 database:
SELECT
ROUTINE_NAME,
ROUTINE_TYPE,
LEN(ROUTINE_DEFINITION )-len(REPLACE(ROUTINE_DEFINITION,CHAR(10),'')) LOC
FROM INFORMATION_SCHEMA.ROUTINES
COMPUTE SUM(LEN(ROUTINE_DEFINITION )-len(REPLACE(ROUTINE_DEFINITION,CHAR(10),'')))
COMPUTE avg(LEN(ROUTINE_DEFINITION )-len(REPLACE(ROUTINE_DEFINITION,CHAR(10),'')))
Started my programming life writing Excel 1.0 macros, God what a long time ago.
Now I'm a dotnet developer, I get to influence direction, play with new toys, build stuff, life is wonderful.
Greatest buzz you can get, walk past a row of desks and see your application running on all of them (and getting paid).
Greatest irritant, pouring 12 months of knowledge and experience into an empty head only to have it leave.
And now I'm retired, no deadlines, no meetings, no managers (except the ONE) and no users!