Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Transform XML (using xslt ?) to XML already in SQL

Author  Topic 

rternier
Starting Member

44 Posts

Posted - 2009-01-07 : 18:47:08
I have a crap load of XML that I need to transform on our servers.

now I could just manually re-write the update statements, but all I need to do is change:

<WarehouseConfig>
<DocURL>http://mysite.com</DocURL>
<UserName>HappyGilmore</UserName>
</WarehouseConfig>

to:

<WarehouseConfig>
<State>
<DocURL>http://mysite.com</DocURL>
<UserName>HappyGilmore</UserName>
</State>
</WarehouseConfig>

and:
<FTPLocation>
<path>C:\...</path>
</FTPLocation>

to
<WarehouseConfig>
<FTP>
<Path>c:\ninjas_live_here</Path>
</FTP>
</WarehouseConfig>

is it possible to transform XML already in SQL Server? Or would it be easier to do it manually?


----
Killer ASP.NET ninja coding monkeys do exist!
[url]http://weblogs.asp.net/rternier[/url]

PeterNeo
Constraint Violating Yak Guru

357 Posts

Posted - 2009-01-07 : 23:15:38
U need the Modify method to update the XML column, check the below link
http://social.msdn.microsoft.com/forums/en-US/sqlxml/thread/051626c3-6a80-4079-8128-397d19ed59c5/

"There is only one difference between a dream and an aim.
A dream requires soundless sleep to see,
whereas an aim requires sleepless efforts to achieve..!!"
Go to Top of Page
   

- Advertisement -