Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

counting the number of stored procedures Expand / Collapse
Author
Message
Posted Monday, February 23, 2009 4:27 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, February 23, 2009 4:26 AM
Points: 10, Visits: 19
How to count the number of stored procedures inside a database using sql query?

please help
Post #662463
Posted Monday, February 23, 2009 4:59 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:07 AM
Points: 2,802, Visits: 7,107
use Sysobjects

SELECT COUNT(*) FROM sys.sysobjects
WHERE xtype = 'p'


Post #662477
Posted Monday, February 23, 2009 6:32 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 3:41 AM
Points: 13,383, Visits: 25,189
Or, to avoid system tables which can and do change:
SELECT  COUNT(*)
FROM INFORMATION_SCHEMA.ROUTINES AS r
WHERE ROUTINE_TYPE = 'PROCEDURE'



----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #662510
Posted Monday, February 23, 2009 7:27 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 3:18 PM
Points: 37,744, Visits: 30,025
Or, using the 2005/2008 system views

SELECT COUNT(*) 
FROM sys.procedures




Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #662567
Posted Saturday, September 11, 2010 3:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, September 11, 2010 3:54 AM
Points: 2, Visits: 5
SELECT COUNT(*)
FROM sys.procedures
Post #984263
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse