Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find stored procedure
Message
From
16/04/2019 02:04:53
 
General information
Forum:
Microsoft SQL Server
Category:
Database management
Miscellaneous
Thread ID:
01668087
Message ID:
01668094
Views:
34
>>>Hi,
>>>
>>>In my SQL Server 2008 I have tons of databases (for all customers). Some time ago I created a custom stored procedure for one of the customers. I know the stored procedure name. But I can't find it. Is there a command I can execute in my SSMS that will find the SQL database that has this SP?
>>>
>>>TIA
>>
>>Dmitry,
>>
>>The sys.procedures table has that information for you. You can query it by its name column using a regular SELECT statement (assuming you were granted enough privileges).
>
>Antonio,
>First, thank you. But the following SQL Select only returns 2 records:
>
>select * from sys.procedures 
>
>
>And I know I have many SPs in many DBs.

Hmmm, you're right, Dmitry, the table is scoped to a single database.

Hopefully others may offer you a better option, but while we wait for it these two links found in a quick google search may be helpful

* https://dba.stackexchange.com/questions/130399/script-to-find-the-list-of-stored-procedures-in-all-databases
* https://www.red-gate.com/products/sql-development/sql-search/
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform