Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 count of existing storedprocedure in a single db

Author  Topic 

cruxmagi
Starting Member

38 Posts

Posted - 2008-07-25 : 09:06:37
Could you tell me how to count the count of existing storedprocedures.
For example if my "test" database has 10 atoredprocedures,how can i get the 10 using qry

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-25 : 09:17:52
select count(*) from sysobjects where xtype='p'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-25 : 09:17:53
[code]select count(*) from sys.procedures[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

VGuyz
Posting Yak Master

121 Posts

Posted - 2008-07-25 : 09:18:11
By using the below query,you can get the stored procedure in your database

select * from sys.procedures

this query returns some of the system procedures.
You can check it out with

SP_helptext stored_procedure_name
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-25 : 09:18:40
by 1 sec


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

cruxmagi
Starting Member

38 Posts

Posted - 2008-07-25 : 09:28:46
quote:
Originally posted by madhivanan

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

Madhivanan

Failing to plan is Planning to fail



The above query is failed to count the CLR procedures
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-25 : 10:36:18
quote:
Originally posted by cruxmagi

quote:
Originally posted by madhivanan

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

Madhivanan

Failing to plan is Planning to fail



The above query is failed to count the CLR procedures


select count(*) from sys.objects where type in('p','pc')
Go to Top of Page
   

- Advertisement -