SP to Cycle thru All Linked Servers
We have a central DB server for the DBAs to query other SQL servers from. It has linked servers to the various servers that allow us to centralize some processes. Today, I am going to post the basic template I use for cycling thru those servers. This template happens to pull back all of the SQL Job Owners for the various SQL jobs. We do this to prevent PROD jobs from running under a users login. If the user leaves, the jobs will fail and that has caused issues before. Obviously you can change out that the dynamic SQL does but this works well as a basic template to query against all of the other servers to get data and load it back into a single central table to manage the data.  /****** Object:  StoredProcedure [security].[templateCycleAllLinkedServers] ******/ -- ============================================= -- Author: 			 -- Create date: 	 20210526 -- Description: 	 Template for process to cycle thru all the servers to do something -- Calling App: 	 -- Ticket Info: 	 -- 				...