views:

30

answers:

1

Similar to Insert into a temp table from a stored procedure on Sql Server 2000 from last year, but now with a strange error.

I'm using Microsoft SQL Server 2000 to dump results from one stored procedure into the temp table of another procedure. Both procedures are on the same physical server, yet I'm getting an error message as if the second procedure was on a different server.

The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.

The code:

    CREATE TABLE
                #subjects   (
            subject_id          INT             NULL
        ,   subject_name        NVARCHAR(500)   NULL
        ,   crm_company_id      INT             NULL
        ,   customer_no         NVARCHAR(10)    NULL
        ,   order_no            NVARCHAR(10)    NULL
        ,   order_date          DATETIME        NULL
        ,   state_code          NVARCHAR(2)     NULL
        ,   filing_office       NVARCHAR(35)    NULL
        ,   jurisdiction        NVARCHAR(200)   NULL
        ,   invoice_no          NVARCHAR(10)    NULL
        ,   invoice_date        DATETIME        NULL
        ,   invoice_status      NVARCHAR(10)    NULL
    )

    INSERT INTO #subjects (subject_id,subject_name,crm_company_id,customer_no,order_no,order_date,state_code,filing_office,jurisdiction,invoice_no,invoice_date,invoice_status)
    EXECUTE webapp.dbo.subject_search
            @SubjectName    =   @SubjectName
        ,   @StartDate      =   @StartDate
        ,   @EndDate        =   @EndDate
        ,   @CRMCompanyID   =   @CRMCompanyID
        ,   @RoleName       =   @RoleName
+1  A: 

can you post the code of the subject_search procedure, are there any linked servers involved, are there also any distributed transaction inside the code?

SQLMenace
I can't post anything from subject_search, but I can say that it does retrieve data from outside the webapp database, possibly from another server. I'm not sure. I'm just the maintainer of the code. Could that be what's causing the error?
Jordan Roher
Yes if DTC (Distributed Transaction Coordinator) is not turned on and enabled that would be a problem
SQLMenace
All right. I'll look into it.
Jordan Roher