从存储过程插入临时表在 SQL 2000 中生成分布式事务错误
类似于 插入临时表去年,我从 Sql Server 2000 上的存储过程中获取了一个表,但现在出现了一个奇怪的错误。
我正在使用 Microsoft SQL Server 2000 将一个存储过程的结果转储到另一过程的临时表中。这两个过程都在同一台物理服务器上,但我收到一条错误消息,就好像第二个过程在不同的服务器上一样。
操作无法执行 因为 OLE DB 提供程序“SQLOLEDB” 无法开始分布式 交易。
代码:
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以发布 subject_search 过程的代码吗?是否涉及任何链接服务器,代码中是否还有分布式事务?
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?