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
 
     
    