2013-09-30 1 views
-2

다음 xml 형식이 있습니다. 테이블 형식으로 아래의이 데이터를 표시하는Sqlserver에서 XML 변수의 데이터를 읽고 테이블 형식으로 표시 하시겠습니까?

enter image description here

필요. 당신이 당신의 XML이 유효하게하면

Table Format

+1

사용하는 일부 쿼리를 시도? – GriGrim

+0

http://msdn.microsoft.com/pl-pl/library/ms175160.aspx, http://stackoverflow.com/questions/9997520/using-openxml-in-sql-server-2008-stored-proc-insert -order-different-from-xml-doc, http://www.informit.com/articles/article.aspx?p=26499 –

+0

XML의 변경 사항이 제대로 적용되었습니다. 긴급한 상황에서 죄송합니다. 잘못된 XML이 추가되었습니다. . – KuldipMCA

답변

6

, nodes

select 
    t.x.value('FacilityID[1]','int') as FacilityID, 
    t.x.value('Category[1]','int') as CategryID 
from @yourxml.nodes('/Facilities/Facility') t(x) 
관련 문제