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.
views:
62answers:
3
+1
A:
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.
AdaTheDev
2010-02-02 22:28:52
Thanks for the heads up on this. I'm a fan of some of the red gate tools, but I was not aware of the one.
Dave
2010-02-03 14:56:29
No worries - it's literally only just come out which is probably why you wasn't aware of it
AdaTheDev
2010-02-03 15:13:07
+3
A:
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%'
KM
2010-02-02 22:39:27
+1
A:
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.
masoud ramezani
2010-02-03 05:41:21
**this code is better:**, huh? it is the same as my query (which I posted first). You only changed it to _SELECT *_ and limit it to return only procedures (which will result in it missing views and functions that could contain the target string)
KM
2010-02-03 14:57:37