Is there a way to examine SQL Jobs for references to linked servers?
-
30-10-2019 - |
Question
In preparation for migrating a server farm to the cloud, I am attempting to enumerate all the linked servers that have been defined over the years. I also need to find (and correct) the code that references these linked servers.
Here is something I threw togetether to help identify names of objects that refer to the linked server, but this only works against stored procs, views, functions and triggers:
declare @sql varchar(2000)
select @SQL = 'use ?;
print ''?'';
print replicate(''-'',len(''?''));
print '' '';
select object_name(sc.id)
from syscomments sc
where text like ''%TheLinkedServer%''
'
exec sp_msforeachdb @sql
I know I will have to crack open the DTS/SSIS packages...I am just trying to get as many finished as quickly as possible.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange