June 11, 2009 at 9:49 am
Hi!
Does anyone know what i'm supposed to do in order to fix this issue?
Unable to start a nested transaction for OLE DB provider "SQLNCLI" for linked server "LINKED_SERVER". A nested transaction was required because the XACT_ABORT option was set to OFF.
This error is happening on a new sql server we are adding for serving a very demanding site, and it's a COPY of those that are already working. On many places suggest to add "SET XACT_ABORT ON" before executing the problematic command, I can't add "SET XACT_ABORT ON" and it shouldn't be necesary since it's already working whihout that command on other instances.
I don't know what else to try 🙁
Thanks in advance!
June 12, 2009 at 2:26 am
Have you looked at the MS article?
June 12, 2009 at 6:41 am
I'll take a look. Thanks much!!!
Anyhow, it's very weird. All servers are configured equally and now seems to be no difference.
The first step I had to set up the Network DTC access, after setting up that I'm getting this new error.
June 12, 2009 at 8:15 am
3 questions related to this problem
- How do I check the current value for XACT_ABORT?
- Once I ser XACT_ABORT to ON remains like that until you explicity set to OFF or it has at scope and after that come back to false?
- I've read this from other site
"Also, I looked at the Linked Server provider options for SQLNCLI and came accross the Nested Queries option being unchecked. I checked the option and applied it to the Linked Server."
Is this possible? I mean, activate nestes queries for SQLNCLI? If yes.. where?
Thanks a lot 🙂
July 16, 2009 at 1:48 pm
Server Objects, Linked Servers, Providers, SQLNCLI. Right-click and choose Properties...
Be very careful about changing settings.
November 28, 2011 at 8:19 am
This is what I did to fix my issue.
ALTER Procedure [dbo].[sp1]
@appID int
as
--begin
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
SET XACT_ABORT ON
Declare @TranID int
BEGIN TRAN
Select @TranID = NextTransactionID
From [linked_svr1].[db1].[dbo].[tbl1]
Where ApplicationID = @appID
SET @TranID = @TranID + 1
UPDATE [linked_svr1].[db1].[dbo].[tbl1]
SET NextTransactionID = @TranID
WHERE ApplicationID = @appID
IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN
END
COMMIT TRAN
Select @TranID
SET XACT_ABORT OFF
November 29, 2011 at 12:46 pm
Andy,
This type of sequence table logic can be problematic if 2 processes hit the table at the same time requesting the next TranID (sequence number). You can get the next sequence number and update the table in one statement that is already an implicit transaction. I've been using this type of sequencing for years with no problems. In this example I'm not using a distributed transaction
UPDATE Tbl1
SET
@TranID = NextTransactionID
, NextTransactionID = NextTransactionID + 1
WHERE ApplicationID = @appID
There is no need to create an explicit transaction since the UPDATE is an implicit transaction anyway.
I've not used this technique specifically across linked servers, but I see no reason for it not to work.
Regards,
Todd Fifield
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply