I have a piece of code that need to run as a recurrent SQL job.
When running the code as simple query inside the SQL Server query editor it runs successfully and return the expected results (merging several lines from the XML into an existing table).
But when creating a new job for SQL Server Agent, adding a single step that need to run the exact same script, it always fails when trying to execute
INSERT #xml ( [XMLData] )
Error message is:
Executing as user 'myUser': XML Parsing: line 19 column 0, unexpected end of input.
If the XML was invalid in any way then this error message would appear when executing the same line in it's script version. It must be something else.