Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stored Procedure Location


Stored Procedure Location

Author
Message
tt-615680
tt-615680
Old Hand
Old Hand (334 reputation)Old Hand (334 reputation)Old Hand (334 reputation)Old Hand (334 reputation)Old Hand (334 reputation)Old Hand (334 reputation)Old Hand (334 reputation)Old Hand (334 reputation)

Group: General Forum Members
Points: 334 Visits: 1201
Hi All,

I'm trying to work out how to find out where and how many times a particular stored procedure is located, I thought I can find out in the sys objects tables but I guess I was wrong. I would be very grateful if some would let me know please.

Thank you,
Arjun SreeVastsva
Arjun SreeVastsva
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2529 Visits: 1642
select * from sys.procedures
Sean Lange
Sean Lange
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16667 Visits: 17030

select * from sysobjects where xtype = 'p'



Will return the same list. What I don't quite understand is what exactly are you looking for?


I'm trying to work out how to find out where and how many times a particular stored procedure is located


Each stored procedure is stored in the database where it was created and by definition it can only be there once.

Are you trying to find which database(s) a particular named stored proc is located across all databases on a given server? Like you have a GetEmployeeList in several databases and you want to find which databases that one resides in? If the latter is what you are after you will have to use the officially undocumented system procedure "sp_msforeachdb".

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Ninja's_RGR'us
Ninja's_RGR'us
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20941 Visits: 9671
You can't see objects if you don't have permissions on it.
Suresh B.
Suresh B.
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1128 Visits: 5326
tt-615680 (8/10/2011)
Hi All,

I'm trying to work out how to find out where and how many times a particular stored procedure is located, I thought I can find out in the sys objects tables but I guess I was wrong. I would be very grateful if some would let me know please.

Thank you,
Tizita

In your post, it is not clear whether you are searching within a single database or all the databases.

If you are searching for multiple occurances of a stored procedure within a single database...
I think the stored procedure is created on different schemas. Join sys.schemas to sys.objects. That should give you correct result.

If you are searching all the databases use sp_msforeachdb.
f_matthews
f_matthews
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 144
If you need to know where the undocumented SP are, master system stored procedures. viewing them may give you good insights on how to utilize them.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search