anusql74 - Monday, April 16, 2018 9:00 AM
One way to do this is to use OPENQUERY for Linked Servers. For example, creating an Agent Job on SQL1 with the following code might work.
USE TempDB;
create table #sqltest_temp (sqlversion nvarchar(max))
insert into #sqltest_temp
select * from table
union
select * from openquery(SQL2,'Select @@SERVERNAME')
union
select * from openquery(SQL3,'Select @@SERVERNAME')
insert into [DatabaseName].[dbo].[sqlversion_anu]
Select * from #sqltest_temp
GO
drop table #sqltest_temp
=======================================================================