Question

I tried exec sp_depends @objname = 'sfel.elpc' but I did not get any results, but I know the synonym is referenced in at least one stored procedure.

Was it helpful?

Solution

this code is better:

SELECT 
*
FROM sys.sql_modules m 
    INNER JOIN sys.objects o ON m.object_id=o.object_id
WHERE m.definition Like '%sfel.elpc%' and type = 'p'

this code give you a more limited list of objects.

OTHER TIPS

try:

SELECT DISTINCT
    o.name,o.type_desc
    FROM sys.sql_modules        m 
        INNER JOIN sys.objects  o ON m.object_id=o.object_id
    WHERE m.definition Like '%sfel.elpc%'

You could try SQL Search by Red Gate, which is free. I'm by no means sure whether it supports synonyms, but might be worth a try if no other solutions are suggested.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top