Hi.
I am trying to loop through 18 servers to get the data into one excel spreadsheet/tab. I do have a code for every single server that are the same yet in the where clause, the environmentid changes to specific code for each server. I cannot use the UNION ALL in code as not allowed per company's server admins :/
from [planintegration].[dbo].[processlogheader] (NOLOCK) where processlogtypeid like 'AutoQ%'
and createdate >= getdate()-30
and [environmentid] = 4 (the code is different in each server)
You can see 2 different open SQL connections here.