Search Results for 'modify메소드'


1 POSTS

  1. 2009/02/25 [SQL Server] XML의 특정값 수정하기 by 좐군

[SQL Server] XML의 특정값 수정하기

SQL Server 2005에서 XML 타입의 modify()메소를 이용하여 XML의 특정값을 수정하는 예제이다.  
XML DML에서 replace value of xpath with value 구문을 이용하는 것이다.

DECLARE @xml XML
SELECT  @xml = N'<root>
                  <elements>
                     <event id="1"/>
                  </elements>
                 </root>'
SET @xml.modify('
replace value of (/root/elements/event/@id)[1]
with "999"
')
SELECT @xml --Result --@xml='<root><elements><event id="999" /></elements></root>'


이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by 좐군

2009/02/25 23:41 2009/02/25 23:41
, ,
Response
No Trackback , No Comment
RSS :
http://John.tobe30.com/tc/rss/response/77

Trackback URL : http://John.tobe30.com/tc/trackback/77

Leave a comment
[로그인][오픈아이디란?]