Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8558123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:44:14+00:00 2026-06-11T15:44:14+00:00

I’m trying to parse this out. I want one record for each event, so

  • 0

I’m trying to parse this out. I want one record for each event, so I need a way to query each event separately.

But I’d like it to look something like this:

Event Name                                         || ID  || Timestamp || process_utilization
---------------------------------------------------------------------------------------------
scheduler_monitor_system_heal_ring_buffer_recorded ||  0  || 0         || 33

Here’s the XML:

<events>
  <session startTime="2012-09-06T10:48:15.373" droppedEvents="0" largestDroppedEvent="0">
    <RingBufferTarget truncated="0" processingTime="0" totalEventsProcessed="14" eventCount="14" droppedCount="0" memoryUsed="3994">
      <event name="scheduler_monitor_system_health_ring_buffer_recorded" package="sqlos" timestamp="2012-09-19T16:46:33.091Z">
        <data name="id">
          <type name="uint32" package="package0" />
          <value>0</value>
        </data>
        <data name="timestamp">
          <type name="uint64" package="package0" />
          <value>0</value>
        </data>
        <data name="process_utilization">
          <type name="uint32" package="package0" />
          <value>33</value>
        </data>
      </event>
      <event name="resource_monitor_ring_buffer_recorded" package="sqlos" timestamp="2012-09-19T16:46:38.386Z">
        <data name="id">
          <type name="uint32" package="package0" />
          <value>0</value>
        </data>
      </event>
    </RingBufferTarget>
  </session>
</events>

EDIT:
Alternatively, if we could return rows that look like this, that would be Just Fine:

scheduler_monitor_system_heal_ring_buffer_recorded || id || 0
scheduler_monitor_system_heal_ring_buffer_recorded || timestamp || 0
scheduler_monitor_system_heal_ring_buffer_recorded || process_utilization|| 33

EDIT: (Thanks, Mark)
Using Mark’s code, I got this which is 98% of what I want – just need the Event Name.

SELECT
    DataName = Evt.value('@name[1]', 'varchar(50)'),
    TypeName= Evt.value('type[1]/@name[1]', 'varchar(50)'),
    DataValue = Evt.value('value[1]', 'varchar(50)'),
    DataText = Evt.value('text[1]', 'varchar(50)')
FROM 
    @input.nodes('/events/session/RingBufferTarget/event/data') as Tbl(Evt)

which returns:

id                  uint32  0   NULL
timestamp           uint64  0   NULL
process_utilization uint32  33  NULL
id                  uint32  0   NULL

(but, obviously, need the event name)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:44:16+00:00Added an answer on June 11, 2026 at 3:44 pm

    Assuming you have your XML in a variable called @input, try this:

    declare @input XML = '....(your XML here).....';
    
    SELECT
        EventName = Evt.value('(@name)[1]', 'varchar(50)'),
        EventID = Evt.value('(data[@name="id"]/value)[1]', 'int'),
        EventTimeStamp = Evt.value('(data[@name="timestamp"]/value)[1]', 'bigint'),
        ProcessUtilization = Evt.value('(data[@name="process_utilization"]/value)[1]', 'int')
    FROM 
        @input.nodes('/events/session/RingBufferTarget/event') as Tbl(Evt)
    

    With your sample XML, I get an output of:

    EventName                                           EventID   EventTimeStamp ProcessUtilization
    scheduler_monitor_system_health_ring_buffer_record     0          0              33
    resource_monitor_ring_buffer_recorded                  0         NULL            NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
Basically, what I'm trying to create is a page of div tags, each has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to construct a data frame in an Rcpp function, but when I
I need to clean up various Word 'smart' characters in user input, including but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.