I came across a situation where I had to find the list of all such stored procedures defined in a specific database containing at least one cursor in their code. The following query worked for me.SELECT DISTINCT P.NAME FROM SYSCOMMENTS SCINNER JOIN SYS.procedures P ON P.OBJECT_ID = SC.IDAND P.NAME LIKE 'SP%' AND TEXT LIKE '%DECLARE%CURSO...