i want ot convert xml data format into the general data format

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • surya

    i want ot convert xml data format into the general data format

    hi sir
    i have table hh .it has two columns
    one is hhno is integer datatype another hhdoc is xml data type like
    hh table
    hhno hhdoc
    ------------
    ---------------------------------------------------------------------------------
    100
    <suresh>sfjfjfj fjf</suresh>........ ............... .............
    101
    <ramesh>hhfhfhf </ramesh>........ ............... ...........


    how to convert the xml data format into the general data format pls
    help me with examples

  • Dan Guzman

    #2
    Re: i want ot convert xml data format into the general data format

    > how to convert the xml data format into the general data format pls[color=blue]
    > help me with examples[/color]

    What do you mean by 'general format'? The following example shows one
    method to return the root element text:

    CREATE TABLE Table1
    (
    hhno int NOT NULL
    CONSTRAINT PK_Table1 PRIMARY KEY,
    hhdoc xml
    );

    INSERT INTO Table1
    SELECT 100, '<suresh>sfjfjf jfjf</suresh>'
    UNION ALL SELECT 101, '<ramesh>hhfhfh f</ramesh>';

    SELECT hhno, hhdoc.query('*/text()')
    FROM Table1;

    --
    Hope this helps.

    Dan Guzman
    SQL Server MVP

    "surya" <suryaitha@gmai l.com> wrote in message
    news:1149850644 .769850.143640@ c74g2000cwc.goo glegroups.com.. .[color=blue]
    > hi sir
    > i have table hh .it has two columns
    > one is hhno is integer datatype another hhdoc is xml data type like
    > hh table
    > hhno hhdoc
    > ------------
    > ---------------------------------------------------------------------------------
    > 100
    > <suresh>sfjfjfj fjf</suresh>........ ............... .............
    > 101
    > <ramesh>hhfhfhf </ramesh>........ ............... ...........
    >
    >
    > how to convert the xml data format into the general data format pls
    > help me with examples
    >[/color]


    Comment

    Working...