How to find if a stored procedure exists in the database

Document ID : KB000034598
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

A current case required an SQL query to find a missing stored procedure. Following qeury can be used to find if a stored procedure exists in the database.



Procedure:

select * from <SLM Database name>.information_schema.routines
where routine_type = 'PROCEDURE' and specific_name like 'name of stored procedure you are looking for%';

For example:

select * from nimsoftslm.information_schema.routines
where routine_type = 'PROCEDURE' and specific_name like 'spn_GetQosData%';


If a given stored procedure is missing where in that particular of NMS version it was supposed to be present, then there is a fair chance that an installation or an upgrade hasn't successfully completed.