xml 핸들링 시 필요 없는 노드 정리를 위한 방법.
DECLARE @myDoc xml SET @myDoc = '<?Instructions for=TheWC.exe ?> <Root> <!-- instructions for the 1st work center --> <Location LocationID="10" LaborHours="1.1" MachineHours=".2" >Some text 1 <step>Manufacturing step 1 at this work center</step> <step>Manufacturing step 2 at this work center</step> </Location> </Root>' SELECT @myDoc -- delete an attribute SET @myDoc.modify(' delete /Root/Location/@MachineHours ') SELECT @myDoc -- delete an element SET @myDoc.modify(' delete /Root/Location/step[2] ') SELECT @myDoc -- delete text node (in <Location> SET @myDoc.modify(' delete /Root/Location/text() ') SELECT @myDoc -- delete all processing instructions SET @myDoc.modify(' delete //processing-instruction() ') SELECT @myDoc
참고 Url : https://msdn.microsoft.com/en-us/library/ms190254.aspx
- [2015/09/18] Select Box Option 동적 추가 , 삭제 , 복사 (7107)
- [2015/08/26] unix_timestamp 을 MSSQL 상에서 YYYY-MM-DD hh:mm:ss 포맷으로 상호 변환 (1539)
- [2015/08/19] Login failed for user 'userid'. (Microsoft SQL Server, Error : 18456) (1236)
- [2015/07/13] SQL Server Management Studio(SSMS) 메모리 점유율 문제 (1751)
- [2015/01/29] 2015 SQL UNPLUGGED 세미나 (529)