ํฐ์คํ ๋ฆฌ ๋ทฐ
XML์ MSSQL ๋ ์ฝ๋๋ก ๋ง๋ค๊ธฐ. Inserting xml data into sql server Table
๐ฅ fire 2013. 9. 11. 15:32ํ ์ฌ์ดํธ์ ์๋ ์ค๋ผํด ํ ์ด๋ธ์์
๋ฐ์ดํฐ๋ฅผ ์ฐธ์กฐํ์ฌ ์ฐ๋ฆฌ์ชฝ ๋ฐ์ดํฐ์ ๋งค์นญํ ์ผ์ด ์๊ฒผ๋ค.
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
'MS-SQL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์ธ๋ฑ์ค ์์ฑ ๋ฐ ์ญ์ (0) | 2013.12.12 |
---|---|
ํ ์ด๋ธ ์์ (0) | 2013.09.27 |
SQL server 2008 Lock ํด์ (0) | 2013.08.29 |
๋๋ธ์ฟผํ ์ ๋ณํ (0) | 2013.07.25 |
ํฌ์ธํธ ์ ๋ฆฝ ๋ง์ดํ ์ ์์ 5% ํฌ์ธํธํฉ๊ณ, ์ธ์ ๊ตฌํ๊ธฐ (0) | 2012.07.06 |
- Total
- Today
- Yesterday
- 2ne1
- JS
- asp
- I Don't Care
- ์์์ฌ์ด๋
- Ajax
- JSON
- ์๋ธ๋ฆฟ
- EL
- JSP
- ๋์ค
- ์น์์ด์ ์
- MySQL
- ๋ณต๊ทผ์ด๋
- JSTL
- jQuery
- Servlet
- ์๋ฆฌ
- Java
- 8๋ง์ผ
- ํจ์
- MS-SQL
- ์นด๋ฐ์จ๋ผ์ธ
- ๋ฉ๋ฐฐํ
- php
- JavaScript
- ์ธํจ์ด
- ์๋ฐ์คํฌ๋ฆฝํธ
- ๊ฒฝ์ ์ฉ์ด
- ๊ธฐํ
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |