Hi,I am running the below query, which joins multiple tables from different servers:[code="sql"]select job.Name from msdb.dbo.sysjobs_view job inner join msdb.dbo.sysjobactivity activity on (job.job_id = activity.job_id) where run_Requested_date is not null and stop_execution_date is null and job.name like 'UGC Restores%' union all select job.Name from RO.msdb.dbo.sysjobs_view job inner join RO.msdb.dbo.sysjobactivity activity on (job.job_id = activity.job_id) where run_Requested_date is not null and stop_execution_date is null and job.name like 'RO Restores%' union all select job.Name from ODS.msdb.dbo.sysjobs_view job inner join ODS.msdb.dbo.sysjobactivity activity on (job.job_id = activity.job_id) where run_Requested_date is not null and stop_execution_date is null and job.name like 'ODS Restores%'[/code]I am getting this error message:Microsoft Distributed Transaction Coordinator (MS DTC) has stopped this transaction.If I enclose this query into: [code="sql"]begin distributed transaction...commit transaction[/code]Everything runs fine.However other queries start throwing this error message when I do this:[code="sql"]Cannot use SAVE TRANSACTION within a distributed transaction.[/code]How do I run the distributed queries without: [code="sql"]begin distributed transaction...commit transaction[/code]I am using SQL Server 2014 Ent edition.Thanks.
↧