• davidthegray (7/8/2008)


    Does anybody have a ready made query to find out the list of all the stored procedures in a db having the word 'CURSOR' inside their SQL body text? 🙂

    Hi David,

    Emamet already gave a query that works for SQL Server 2005 (and probably 2008 as well).

    For SQL Server 2000, you can use the query posted by Marius, though there are some caveats with it that I'll point out in a seperate reply.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/