Need help on the following issue:
Case 1 : the stored procedure is on server 1 - a call from server1
declare @tempCountry table (countryname char(50)) insert into @tempCountry exec [database1_server1].[dbo].[getcountrylist] Select * from @tempCountry
Result: successful execution
Case2 : i If the same stored procedure is called from another server using the linked server as follows:
declare @tempCountry table (countryname char(50)) insert into @tempCountry exec [database2_server2].[database1_server1].[dbo].[getcountrylist] Select * from @tempCountry
Result
Msg 7391, Level 16, State 2, Line 2
The operation could not be completed because the OLEDB provider "SQLNCLI" for linkedserver "Server2_Database2" could not start the distributed transaction.
Case 3
But when you try to execute the stored procedure separately [without inserting a temporary table], as shown below
exec [database2_server2].[database1_server1].[dbo].[getcountrylist]
Result: a stored procedure is executed without any errors and data return.
I forgot to mention that I am using SQL Server 2005. According to the server administrator, the function that you proposed to use is not available in 2005.
source share