Is it possible to find the objects which depend on a synonym?
-
25-09-2019 - |
문제
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.
해결책
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.
다른 팁
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.
제휴하지 않습니다 StackOverflow