By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,837 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jun 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> 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" <su*******@gmail.com> wrote in message
news:11**********************@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

Jun 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.