SqlXMLBulkLoad error

  • I am trying to load a large xml file using sqlxmlbulkload in SSIS script task. It started loading for a while and then broke with an error, which I quote over here

    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0xC00CEE26): An attribute value must not contain '<'.

    at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)

    at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)

    at ST_81ef1be7930442b8a67144e13b010af2.vbproj.ScriptMain.Main()

    --- End of inner exception stack trace ---

    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

    at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

    Can anyone offer any suggestions to solve the problem? Thanks ahead!

  • It sounds like a data error - as if the XML file is not well formed.

    Do previous files still execute successfully? If so, that's almost certainly the problem.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thanks, Phil.

    The previous load is using XML Source in SSIS and there seems no problem. I queried the loaded data and did find invalid characters like "&" or "<" existing in the field named "URL".

    Since that requires loading xml data into memory, I am testing the feasibility of using sqlxmlbulkload. I am wondering if there is a good way loading these dirty data using bulk load. Any suggestion would be appreciated!

    Happy Cooking Turkeys!

  • david.hao 17731 (11/26/2013)


    Thanks, Phil.

    The previous load is using XML Source in SSIS and there seems no problem. I queried the loaded data and did find invalid characters like "&" or "<" existing in the field named "URL".

    Since that requires loading xml data into memory, I am testing the feasibility of using sqlxmlbulkload. I am wondering if there is a good way loading these dirty data using bulk load. Any suggestion would be appreciated!

    Happy Cooking Turkeys!

    Sounds like any XML parser will fail with that file. So the file needs to change first ... somehow.

    If it were me, I would be speaking to the creator of the file and asking them to fix things up. Presumably they've signed up to creating valid XML and, if so, they've violated their agreement and should put things right.

    Another option is to pre-process the file somehow - a script task would work - and use that to replace/remove the invalid characters before the file is processed as usual.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply