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

  • Home
  • SEARCH
  • 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 6816299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:54:33+00:00 2026-05-26T20:54:33+00:00

Is it possible from this example table: CREATE TABLE #Actions(EmployeeId INT,EmployeeName VARCHAR(100),ActionStart TIME,ActionEnd TIME,Type

  • 0

Is it possible from this example table:

CREATE TABLE #Actions(EmployeeId INT,EmployeeName VARCHAR(100),ActionStart TIME,ActionEnd TIME,Type VARCHAR(10));
INSERT INTO #Actions(EmployeeId,EmployeeName,ActionStart,ActionEnd, Type)
VALUES (1,'Bob','09:00','12:00', 'action'),(1,'Bob','14:30','16:00', 'action'),(1,'Bob','18:00','20:00', 'event'),(2,'Susan','10:00','12:00', 'action');

to have this output in XML?

<div class="employee" employeeid="1" employeename="Bob">
    <div class="action" start="09:00" end="12:00" type="action"></div>
    <div class="action" start="14:30" end="16:00" type="action"></div>
    <div class="action" start="18:00" end="20:00" type="event"></div>
</div>
<div class="employee" employeeid="2" employeename="Susan">
    <div class="action" start="10:00" end="12:00" type="action"></div>
</div>
  • 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-05-26T20:54:33+00:00Added an answer on May 26, 2026 at 8:54 pm
    select 'employee' as '@class',
           a1.EmployeeId as '@employeeid',
           max(a1.EmployeeName) as '@employeename',
           (select 'action' as '@class',
                   left(a2.ActionStart, 5) as '@start',
                   left(a2.ActionEnd, 5) as '@end',
                   a2.Type as '@type'
            from #Actions as a2
            where a1.EmployeeId = a2.EmployeeId
            for xml path('div'), type)
    from #Actions as a1
    group by a1.EmployeeId
    for xml path('div')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example I have the following tables resulting from: CREATE TABLE A (Id int,
Is it possible to re-write (Apache Mod-Rewrite) a URL from this: http://www.example.com/view.php?t=h5k6 to this
Given this table: CREATE TABLE [Comments] ( [Id] [int] IDENTITY(1, 1) NOT NULL, [Text]
In the context of this question link text is possible from a Controller that
Supposedly, it is possible to get this from Google Maps or some such service.
Is it possible to call functions from class like this: $class = new class;
I am coming from c# where this was easy, and possible. I have this
Is this possible? I've followed the instructions from here ( http://www.jetbrains.net/confluence/display/TCD4/Setting+up+an+External+Database#SettingupanExternalDatabase-MicrosoftSQLServer2005 ) but I
Also is it possible to combine this with removing periods from within the string?
Is this possible? Using SQL Server 2005....... SELECT * FROM Data0304 UNION SELECT *

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.