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: Friday, May 30, 2014 6:27 PM
Points: 2,808, Visits: 7,175
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: Today @ 8:22 AM
Points: 14,205, Visits: 28,534
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 Query Performance Tuning
and
SQL Server Execution Plans

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


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:36 AM
Points: 40,615, Visits: 37,080
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