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 8177149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:26:17+00:00 2026-06-06T23:26:17+00:00

I have the xml structure below. I am trying to create a temp table

  • 0

I have the xml structure below. I am trying to create a temp table by using return result but I couldnt do it.

declare @xml xml
set @xml = '
<Root>
  <ValueHolder>
     <Value>3.00</Value>
     <IsNoteDirty>false</IsNoteDirty>
     <Timestamp>
        <StampType>Month</StampType>
        <Stamp>3</Stamp>
        <Year>2007</Year>
     </Timestamp>
     </ValueHolder>
  <ValueHolder>
     <Value>23.00</Value>
     <IsNoteDirty>false</IsNoteDirty>
     <Timestamp>
        <StampType>Month</StampType>
        <Stamp>3</Stamp>
        <Year>2007</Year>
     </Timestamp>
     </ValueHolder>
</Root>'


select Tab.Col.value('(Value)[1]','MONEY') 
          from @xml.nodes('/Root/ValueHolder') Tab(Col)

This code works perfect. What I am trying to do is, putting this result to a temp table. I tried this one but it doesnt work

select * into #TempTable
    from (select Tab.Col.value('(Value)[1]','MONEY') 
          from @xml.nodes('/Root/ValueHolder') Tab(Col))

The error message is

Msg 102, Level 15, State 1, Line 26 Incorrect syntax near ‘)’.

  • 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-06T23:26:19+00:00Added an answer on June 6, 2026 at 11:26 pm

    Try something like this instead:

    select MoneyValue = Tab.Col.value('(Value)[1]', 'MONEY') 
    into #TempTable
    from @xml.nodes('/Root/ValueHolder') Tab(Col) 
    

    Works just fine if I do it this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two XML files. The structure of both XML files is as below:
I have to parse a 1Gb XML file with a structure such as below
I am trying to create a dynamic menu by reading an XML file using
I have a xml structure similar to below one: <test> <test1>test1 value</test1> </test> Now
I have a XML file with the structure as shown below: <x> <y/> <y/>
I have following XML generated by serializing a boost::posix_time::ptime structure. I want to create
I have an xml file with the below structure: <connections> <connection> <serverName>serverName1</serverName> <dbName>dbName1</dbName> </connection>
I have an XML file that will be similar to the structure below: <?xml
I have xml structure like this: <Group id=2 name=Third parentid=0 /> <Group id=6 name=Five
I have XML structure. <cars> <car name = BMW engine=2.5/> <car name = Lexus

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.