Xml Parsing Issue in sql job

自古美人都是妖i 提交于 2019-12-03 16:34:25

Do you know about the Sql Agent TEXTSIZE?

Specify directly in the procedure TEXTSIZE 512 and exec, you'll get the same error in this case

SET TEXTSIZE -1

OR other value, i use -1 for unlimited size by default sql server textsize on the SQL Agent is 512

Your code how to get a flat file via URL works fine...

After this

INSERT @xmlT ( yourXML )
EXEC @Result = sp_OAGetProperty @Obj, 'responseXML.xml'

... your declared table variable contains one row with a valid XML.

"line 10 character 33" might point to

  1. totally cut due to a to small varchar variable somewhere in between
    • in my test the line 10 doesn't even have so many characters...
    • Might be, that the content of the file varies, but the first 10 lines seem to carry quite steady data...
    • Try to change your @xmlT to store a VARCHAR(MAX) and do a pure SELECT. The file comes as pre-formatted, "pretty" xml... So: the reported line and character numbers should be OK...
  2. invalid XML (e.g. missing closing tag)
    • If the XML is invalid from the source it should not make a difference how you call it...
  3. invalid character
    • Might be, that there is some problem with the encoding

My favorite is 1): As the reflected error speaks about "XML Parsing - Unexpected end of input" I'd suppose, that the XML you read is cut somewhere...

Find out

  • if you get the same error independing of the XML's content.
  • if you get it always and always with the same line and character number
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!