0

is there a way to make a query which DB the Stored Procedure is located? I got this bunch of Databases doing a lot of Cross DB query from each other, now I got lost with 1 stored procedure and I just want to look from which DB it is located. I want to make a script that will return the DB name of where that stored procedure is located.

Is this possible?

rob waminal
  • 18,117
  • 17
  • 50
  • 64

1 Answers1

1

Look to this question Query to list all stored procedures

Community
  • 1
  • 1
Michael Pakhantsov
  • 24,855
  • 6
  • 60
  • 59
  • can't we do just like `select * from information_schema.blah where procedure_name = 'procedure_name'` and this will search to all the databases? – rob waminal Jul 29 '10 at 06:50
  • 1
    No it will search only inside particular database (if not specified then will used current). However you can create a view, if you know list of databases, which you use. And try search in the view. – Michael Pakhantsov Jul 29 '10 at 07:01