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>sfjfjfjfjf</suresh>...........................
101
<ramesh>hhfhfhf</ramesh>..........................
how to convert the xml data format into the general data format pls
help me with examples> how to convert the xml data format into the general data format pls
> help me with examples
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>sfjfjfjfjf</suresh>'
UNION ALL SELECT 101, '<ramesh>hhfhfhf</ramesh>';
SELECT hhno, hhdoc.query('*/text()')
FROM Table1;
--
Hope this helps.
Dan Guzman
SQL Server MVP
"surya" <suryaitha@.gmail.com> wrote in message
news:1149850644.769850.143640@.c74g2000cwc.googlegr oups.com...
> 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>sfjfjfjfjf</suresh>...........................
> 101
> <ramesh>hhfhfhf</ramesh>..........................
>
> how to convert the xml data format into the general data format pls
> help me with examples
No comments:
Post a Comment