Forum Replies Created

Viewing 4 posts - 136 through 139 (of 139 total)

  • RE: inserting the xml elements into existing table

    No Problem. thanks for the feedback.

  • RE: extract data out of XML with two namespaces

    Here is a slightly revised query that should work with the example xml:

    WITH XMLNAMESPACES(

    'http://informationsystems/schema/messages' as s,

    'http://controlsystems/schema/Events' as m,

    default 'http://informationsystems/schema/messages'

    )

    SELECT

    x.value('(TrainCycleID)[1]','int') AS TrainCycleID,

    x.value('(Job)[1]','int') AS JobID,

    x.value('(s:UnloadingEvent/m:Events/m:LogixEvent/m:DateAndTime)[1]','varchar(max)') AS EventDateAndTimeZulu,

    x.value('(s:UnloadingEvent/m:Events/m:LogixEvent/m:UnloadingEvent/m:UnloadingOperatorAction/m:StartTrain/m:DumpStation)[1]','varchar(max)') AS Dumpstation,

    x.value('(s:UnloadingEvent/m:Events/m:LogixEvent/m:UnloadingEvent/m:UnloadingOperatorAction/m:StartTrain/m:Destination)[1]','varchar(max)') AS Destination

    FROM...

  • RE: image to xml and xmlns="urn:" issue

    You can get the namespace by adding this with clause just before the query:

    e.g.

    with xmlnamespaces (default 'urn:reviewset-1.0')

    select .....

    Not sure why you are having problems with the image not coming through....

  • RE: inserting the xml elements into existing table

    This is one way to shred the example xml into the format ready for you to insert into a table:

    select c.value('../../name[1]', 'varchar(100)'),

    c.value('artno[1]', 'varchar(100)'),

    c.value('description[1]', 'varchar(100)'),

    c.value('price[1]', 'money')

    from @x.nodes('//article') t(c)

    Hope this gets you...

Viewing 4 posts - 136 through 139 (of 139 total)