|
Execute the following
Microsoft SQL Server T-SQL script in SSMS Query Editor to list all sprocs which use cursors:
USE AdventureWorks
GO
SELECT DISTINCT s.Name Owner,
o.name [Stored Procedure]
FROM sys.objects o
JOIN (SELECT id
FROM sys.syscomments
WHERE encrypted = 0
AND [text] LIKE '%cursor%') sc
ON sc.id = o.object_id
JOIN sys.schemas s
ON o.schema_id = s.schema_id
ORDER BY Owner,
[Stored Procedure]
/* Owner Stored Procedure
dbo uspDBREINDEXFragmentedTables */
Related article:
Search Stored Procedures with SQL in SQL Server
|