January 14, 2008 at 2:09 am
Hi
Just like we have xQuery capabilities in SQL 2005, do we have any option in SQl 2000 to alter the XML.
All the examples I can find are related with selecting data but how can I alter xml content like inserting an element or inserting an attribute in SQl 2000? Do I need to resort to string functions or the XML features of SQL 2000 has such capabilities. Appreciated if one can give a simple example of adding a attribute to existing element in xml using sql 2000.
January 14, 2008 at 5:18 am
2000 doesn't support XQuery. You will have to use string functions. I don't have any samples because, frankly, it wasn't worth doing in TSQL in 2000. Instead we used VB, C#, whatever. If you really need to do XML manipulation in 2000, I'd recommend the same or going to 2005.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 14, 2008 at 5:23 am
I'm afraid I have to agree, sometimes it's just not worth it.
If you really want to try it, you're best bet may be to insert the data from the XML into a table with the extra data columns in and then export the full dataset back to XML.
January 14, 2008 at 5:46 am
While I still think manipulating XML in 2000 is a waste of time, that's a very good idea. If you absolutely HAVE to do it, taking advantage of what you can do with FOR XML, OPENXML and the tsql structures and methods sure makes sense. Nice one.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply