Does any know how / if it is possible to view all tables/views/stored procedures that depend on a linked server in Sql Server 2008. Basically as if the context menu \"View d
I would recommend changing the middle part of the query to be as below to ensure only when it is used in a query you get a hit. If not you will get a lot of false positives whenever the servername is mentioned.
WHERE
definition LIKE ''%\[' + srv.name + '\].%''
or definition LIKE ''%' + srv.name + '.%''', CHAR(13) + CHAR(10), '') AS Query