【问题标题】:How to increase data retrieval capacity of SQL Server Agent 2005如何提高 SQL Server Agent 2005 的数据检索能力
【发布时间】:2015-08-26 10:16:18
【问题描述】:

我有一个存储过程来从 Web 服务中检索 XML 数据它按我的预期工作。经过一段时间的测试,我想将此存储过程用作 SCHEDULED JOB,然后我使用 T-SQL 'EXEC sp_GetData;' 创建了一个新过程并得到失败的结果(错误 9400)。

我重现了 如果我通过查询编辑器窗口 (EXEC sp_GetData;) 执行它,我的存储过程可以正常工作,但如果检索数据是通过计划作业跟踪 XML 数据的 3 个以上对象,则无法正常工作。

问题: 如何增加 SQL Server 代理以检索所有数据(大约 3MB 文件大小)然后插入到特定表中。

<ArrayOfEmployeeMobilesInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">  
   <EmployeeMobilesInfo>
      <EmployeeCode>00001</EmployeeCode>
      <TitleEN>Mr.</TitleEN>
      <EmpNameEN>John</EmpNameEN>
      <EmpSurnameEN>Doe</EmpSurnameEN>
      <PositionNameEN>Police</PositionNameEN>
      <Title>Mr.</Title>
      <EmpName>John</EmpName>
      <EmpSurname>Doe</EmpSurname>
      <PositionName>Police</PositionName>
      <CenterCode>PP777</CenterCode>
      <Location>PP</Location>
      <Email>john@person.com</Email>
      <DivisionCode>PPD77</DivisionCode>
      <DivisionName>PPD77</DivisionName>
      <DepartmentCode>PDD25</DepartmentCode>
      <DepartmentName>PDD25</DepartmentName>
      <PositionLevel>POC</PositionLevel>
      <PositionWeight>H</PositionWeight>
      <JoinDate>2013-10-01T00:00:00</JoinDate>
      <Mobiles>
         <Mobile>
           <MobileNo>1500111232</MobileNo>
         </Mobile>
      </Mobiles>
      <TerminateDate xsi:nil="true" />
   </EmployeeMobilesInfo>

... x 2

</ArrayOfEmployeeMobilesInfo>

我的存储过程。

SET NOCOUNT ON;

DECLARE @URL NVARCHAR(500);
DECLARE @obj INT;

IF OBJECT_ID('xml_employees', 'U') IS NOT NULL DROP TABLE xml_employees;
IF OBJECT_ID('Employees', 'U') IS NOT NULL DROP TABLE Employees;
CREATE TABLE xml_employees ( resp XML );

SET @URL = 'http://localhost/DataService/Employee.asmx/GetEmployees';

EXEC sp_OACreate 'MSXML2.ServerXMLHttp', @obj OUT
EXEC sp_OAMethod @obj, 'Open', NULL, 'GET', @URL , false
EXEC sp_OAMethod @obj, 'send'

INSERT xml_employees ( resp )
EXEC sp_OAGetProperty @obj, 'responseXML.xml'

错误信息

XML parsing: line 12, character 18, unexpected end of input [SQLSTATE 42000] (Error 9400).  The step failed.

请给我一些建议。 谢谢

编辑 1:尝试将 TEXTSIZE 设置为 this 线程提及

【问题讨论】:

    标签: sql-server xml sql-server-agent


    【解决方案1】:

    设置文本大小 2147483647;救救我!

    SQL Server 代理的默认 TEXTSIZE 是 4KB,但我的实例有 1KB。

    【讨论】:

      猜你喜欢
      • 2011-03-03
      • 1970-01-01
      • 1970-01-01
      • 2010-12-05
      • 2011-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多