Currently, I have this database query which works fine if it runs under the database to which the stored procedure belongs
SELECT sys.objects.name, sys.schemas.name AS schema_name
FROM sys.objects
INNER JOIN sys.schemas ON sys.objects.schema_id = sys.schemas.schema_id
WHERE sys.objects.name = 'usp_gallery_delete'
What I am trying to do is, irrespective of any database I am in, if I execute the passed stored procedure name, I should be able to get the schema name of that stored procedure and also should be able to get the definition of that stored procedure.