久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

將網(wǎng)站 XML-feed 導(dǎo)入 SQL Server

Import website XML-feed to SQL Server(將網(wǎng)站 XML-feed 導(dǎo)入 SQL Server)
本文介紹了將網(wǎng)站 XML-feed 導(dǎo)入 SQL Server的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

希望你們一切順利.

我需要將 XML 源從網(wǎng)站導(dǎo)入到我的 SQL Server 數(shù)據(jù)庫(kù).我對(duì) XML 不太了解.

I need to import an XML-feed from a website to my SQL Server database. I don't know much about XML.

Feed 結(jié)構(gòu)有點(diǎn)復(fù)雜.這是該文件的示例:

The feed structure is an bit complex. Here is the sample of that file:

<line_feed>
<FeedTime>1279519582927</FeedTime>
<lastContest>4103839</lastContest>
<lastGame>58629754</lastGame>
<events>
<event>
    <event_datetimeGMT>2010-07-19 21:30</event_datetimeGMT>
    <gamenumber>174087393</gamenumber>
    <sporttype>Tennis</sporttype>
    <league>abc</league>
    <participants>
        <participant>
            <participant_name>R. Ram</participant_name>
            <contestantnum>4303</contestantnum>
            <rotnum>4303</rotnum>
            <visiting_home_draw>Visiting</visiting_home_draw>
        </participant>
        <participant>
            <participant_name>K. Beck</participant_name>
            <contestantnum>4304</contestantnum>
            <rotnum>4304</rotnum>
            <visiting_home_draw>Home</visiting_home_draw>
        </participant>
    </participants>
    <periods>
        <period>
            <period_number>0</period_number>
            <period_description>Game</period_description>
            <periodcutoff_datetimeGMT>2010-07-19 21:30</periodcutoff_datetimeGMT>
            <period_status>I</period_status>
            <period_update>open</period_update>
            <spread_maximum>250</spread_maximum>
            <moneyline_maximum>1500</moneyline_maximum>
            <total_maximum>250</total_maximum>
            <moneyline>
                <moneyline_visiting>135</moneyline_visiting>
                <moneyline_home>-146</moneyline_home>
            </moneyline>
        </period>
        <period>
            <period_number>0</period_number>
            <period_description>Game</period_description>
            <periodcutoff_datetimeGMT>2010-07-19 21:30</periodcutoff_datetimeGMT>
            <period_status>I</period_status>
            <period_update>open</period_update>
            <spread_maximum>250</spread_maximum>
            <moneyline_maximum>250</moneyline_maximum>
            <total_maximum>250</total_maximum>
            <spread>
                <spread_visiting>2</spread_visiting>
                <spread_adjust_visiting>101</spread_adjust_visiting>
                <spread_home>-2</spread_home>
                <spread_adjust_home>-118</spread_adjust_home>
            </spread>
            <total>
                <total_points>22.5</total_points>
                <over_adjust>-108</over_adjust>
                <under_adjust>-108</under_adjust>
            </total>
        </period>
        <period>
            <period_number>1</period_number>
            <period_description>1st Set</period_description>
            <periodcutoff_datetimeGMT>2010-07-19 21:30</periodcutoff_datetimeGMT>
            <period_status>I</period_status>
            <period_update>open</period_update>
            <spread_maximum>5000</spread_maximum>
            <moneyline_maximum>250</moneyline_maximum>
            <total_maximum>5000</total_maximum>
            <moneyline>
                <moneyline_visiting>114</moneyline_visiting>
                <moneyline_home>-133</moneyline_home>
            </moneyline>
        </period>
    </periods>
</event>
</events>
</line_feed>

能否請(qǐng)您幫幫我,我該如何將數(shù)據(jù)從該提要加載到 SQL Server.

Can you please help me out, how can I approach to load the data from that feed to SQL Server.

另請(qǐng)?jiān)儐?wèn)我是否需要了解此場(chǎng)景的任何其他詳細(xì)信息.等待您的友好回復(fù).

Please also ask me if any other details needed to understand this scenario. Awaiting your kind response.

謝謝,普拉桑特

推薦答案

如果您的 XML 格式良好,您可以將其存儲(chǔ)在 xml 類(lèi)型變量中.然后你可以使用 XPath 從中讀取字段:

If your XML is wel-formed, you can store it in an xml type variable. Then you can use XPath to read fields from it:

declare @xml xml
set @xml = '
<line_feed>
<PinnacleFeedTime>1279519582927</PinnacleFeedTime>
...
'

select @xml.value('(line_feed/events/event/sporttype)[1]', 'VARCHAR(8000)')

這將打印Tennis.

這篇關(guān)于將網(wǎng)站 XML-feed 導(dǎo)入 SQL Server的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Modify Existing decimal places info(修改現(xiàn)有小數(shù)位信息)
The correlation name #39;CONVERT#39; is specified multiple times(多次指定相關(guān)名稱“CONVERT)
T-SQL left join not returning null columns(T-SQL 左連接不返回空列)
remove duplicates from comma or pipeline operator string(從逗號(hào)或管道運(yùn)算符字符串中刪除重復(fù)項(xiàng))
Change an iterative query to a relational set-based query(將迭代查詢更改為基于關(guān)系集的查詢)
concatenate a zero onto sql server select value shows 4 digits still and not 5(將零連接到 sql server 選擇值仍然顯示 4 位而不是 5)
主站蜘蛛池模板: 一级毛片免费看 | 久久久久久久一区二区 | 久久机热 | 亚洲欧美中文日韩在线v日本 | 一级a性色生活片久久毛片 午夜精品在线观看 | 久草新在线 | 亚洲高清视频在线 | 337p日本欧洲亚洲大胆鲁鲁 | 久草福利| 国产福利在线播放麻豆 | 69av在线视频 | 午夜欧美一区二区三区在线播放 | 99tv| 午夜电影福利 | 美女国内精品自产拍在线播放 | 中文字幕精品视频在线观看 | 国产精品日韩欧美一区二区三区 | 国产精品自拍视频 | 97超级碰碰 | 久久亚| 成人影视网 | 欧美亚洲国产成人 | 国产在线1区| 成人福利网 | 黄色片av | 在线观看黄色大片 | 成人免费一区二区三区视频网站 | 色综合色综合色综合 | 人人鲁人人莫人人爱精品 | 91极品视频 | 色婷婷综合在线观看 | 一区免费 | 久久久久久国产精品 | 青青草一区二区 | 久草热播 | 中文字幕一区二区三区在线乱码 | 99视频在线| 午夜精品一区 | 在线免费观看视频你懂的 | 日韩精品一区二区三区 | 91久久久久久久久久久久久 |