ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

ํƒ€ ์‚ฌ์ดํŠธ์— ์žˆ๋Š” ์˜ค๋ผํด ํ…Œ์ด๋ธ”์—์„œ

๋ฐ์ดํ„ฐ๋ฅผ ์ฐธ์กฐํ•˜์—ฌ ์šฐ๋ฆฌ์ชฝ ๋ฐ์ดํ„ฐ์™€ ๋งค์นญํ•  ์ผ์ด ์ƒ๊ฒผ๋‹ค.

sso ๋กœ api๋ฅผ ๋งŒ๋“ค์–ด์„œ xml์„ ๋งŒ๋“ค์–ด ๋†“๊ณ 

๊ฒฐ๊ณผ๊ฐ’์œผ๋กœ... ์ž„์‹œํ…Œ์ด๋ธ”์„ ๋งŒ๋“ค์–ด ๋†“๊ณ  ํ•ด๋‹น ์ž„์‹œํ…Œ์ด๋ธ”๊ณผ Join ํ•œ๋‹ค.

DECLARE @xml xml
SET @xml = N'<Processes>
<Process> <UserID>PW-IT\10819420</UserID>
<MachineName>UTCIT-030</MachineName>
<Date>21-05-2013</Date>
<DocumentTitle>Importing XML file and insert data into SQL server table </DocumentTitle>
<ApplicationName> Windows Internet Explorer provided by Infotech Enterprises Limited</ApplicationName>
<StartTime>12:23</StartTime>
<EndTime>12:24</EndTime>
<Usage>1</Usage>
</Process></Processes> '

 

SELECT
doc.col.value('UserID[1]', 'nvarchar(10)') UserID
,doc.col.value('MachineName[1]', 'varchar(100)') MachineName
,doc.col.value('Date[1]', 'nvarchar(10)') Date
,doc.col.value('DocumentTitle[1]', 'nvarchar(10)') DocumentTitle
,doc.col.value('ApplicationName[1]', 'nvarchar(10)') ApplicationName
,doc.col.value('StartTime[1]', 'nvarchar(10)') StartTime
,doc.col.value('EndTime[1]', 'nvarchar(10)') EndTime
,doc.col.value('Usage[1]', 'nvarchar(10)') Usage
FROM @xml.nodes('/Processes/Process') doc(col)

 

ํŽŒ : http://www.codeproject.com/Questions/596007/Insertingplusxmlplusdataplusintoplussqlplusserverp

๋Œ“๊ธ€