Geeks With Blogs
Gaurav Taneja Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.
Count Procedure

select  count(*) from sysobjects where xtype='P'

other option is below

select CASE(XType) WHEN 'C' THEN 'CHECK constraint'
WHEN 'D' THEN 'Default or DEFAULT constraint'
WHEN 'F' THEN 'FOREIGN KEY constraint'
WHEN 'L' THEN 'Log'
WHEN 'FN' THEN 'Scalar function'
WHEN 'IF' THEN 'Inlined table-function'
WHEN 'P' THEN 'Stored procedure'
WHEN 'PK' THEN 'PRIMARY KEY constraint (type is K)'
WHEN 'RF' THEN 'Replication filter stored procedure'
WHEN 'S' THEN 'System table'
WHEN 'TF' THEN 'Table function'
WHEN 'TR' THEN 'Trigger'
WHEN 'U' THEN 'User table'
WHEN 'UQ' THEN 'UNIQUE constraint (type is K)'
WHEN 'V' THEN 'View'
WHEN 'X' THEN 'Extended stored procedure' END Type
, Count(*) as total from sysObjects
GROUP BY xtype Posted on Monday, May 5, 2008 5:02 PM SQL SERVER | Back to top


Comments on this post: Count No of Procedure in Database

# re: Count No of Procedure in Database
Requesting Gravatar...
Good Its Working.
Left by Riju on Dec 04, 2008 1:12 AM

# re: Count No of Procedure in Database
Requesting Gravatar...
also you can use this one

select * from information_schema.routines where routine_type='procedure'
Left by patel parag on Apr 27, 2011 9:32 PM

Your comment:
 (will show your gravatar)


Copyright © Gaurav Taneja | Powered by: GeeksWithBlogs.net