In stored procedure I am using below statements. But it throwing Distributed transaction error when I ran Stored Proc.
Declare @res int
Declare @mes as v
Enable the options
On Security tab of Local DTC Properties in Component Services.
This is what worked for me:
Inside SQL Server Management Studio, expand Server Objects, then Linked Server, then right click on the linked server in question and choose 'Properties.' Select the 'Server Options' page, and make sure 'Enable Promotion of Distributed Transactions' is set to 'False'
Or you can do it with T-SQL:
USE master;
EXEC sp_serveroption '<<your linked server name>>', 'remote proc transaction promotion', 'false';