Home > Archive > MS SQL XML > November 2006 > cdata all columns automatically









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cdata all columns automatically
jamesd

2006-11-30, 12:16 am

I have an application that is extremely dynamic.

Users can type in their own sql statements and run queries however they
want.

Is there a way using SQL to automaticall wrap all the columns with a
CDATA notation?

EX:
Query
SELECT field1, field2, field3 FROM myTable FOR XML ...

Desired result
<row>
<field1><![CDATA[field1 data]]></field1>
<field2><![CDATA[field2 data]]></field2>
<field3><![CDATA[field3 data]]></field3>
</row>

**PLEASE NOTE** I have no control of the SELECT statement, the users
can select whatever they want. So i cannot use the regular EXPLICIT
col!cdata notation :(

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com