Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. XML select

XML select

Scheduled Pinned Locked Moved Database
xmlhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    byka
    wrote on last edited by
    #1

    Could you help with XML select. Below is my xml however it won't select correct value.

    DECLARE @input AS XML
    SET @input =N'111111111111999999777777'

    SELECT
    Ppl.GroupID.value('(@GroupID)', 'VARCHAR(6)') AS 'GroupID'
    FROM
    @input.nodes('/NewDataSet/GroupID') as Ppl(GroupID)

    Kornfeld Eliyahu PeterK 1 Reply Last reply
    0
    • B byka

      Could you help with XML select. Below is my xml however it won't select correct value.

      DECLARE @input AS XML
      SET @input =N'111111111111999999777777'

      SELECT
      Ppl.GroupID.value('(@GroupID)', 'VARCHAR(6)') AS 'GroupID'
      FROM
      @input.nodes('/NewDataSet/GroupID') as Ppl(GroupID)

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      I do not understand what do you mean by (@GroupID), but you should write it like this:

      Ppl.GroupID.value('.', 'VARCHAR(6)') AS 'GroupID'

      I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups