从xml文件sql server 2008读取数据和插入的最快方法? [英] Fastest way for read data and insert from xml file sql server 2008 ?

查看:122
本文介绍了从xml文件sql server 2008读取数据和插入的最快方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能最快速地读取数据并从xml文件插入sql server 2008

xml文件大小超过50 Mb



可以帮助任何一个?????

how can I Fastest read data and insert from xml file sql server 2008
xml file size is over 50 Mb

can help me any one ?????

推荐答案

将XML作为XML参数发送到SQL storedprocedure并在sql server中进行迭代是您的问题的最佳选择(这可以避免多个数据库连接打开和关闭)



以下内容对您有所帮助,



http://stackoverflow.com/questions/10384745/upsert-on-sql-server-table- from-xml [ ^ ]
Sending the XML to SQL storedprocedure as a XML parameter and iterating in sql server is a best option for your problem(this avoids multiple database connection open & close)

The following will help you,

http://stackoverflow.com/questions/10384745/upsert-on-sql-server-table-from-xml[^]


您好,除了解决方案1:您还可以创建一个CLR存储过程或用户定义的函数,它接受您的xml作为参数,实现XmlReader类(或其他类)和插入da ta到你想要的数据库表。有关xml性能的详细信息,请参阅第9章 - 提高XML性能 [ ^ ]

如果不可能通过CLR disabled指令,由于您的服务器策略,您应该创建与CLR存储过程或用户定义函数相同的独立应用程序。
Hello, in addition to solution 1: you can also create a CLR stored procedure or user defined function which accepts your xml as parameter, implements XmlReader class (or other classes) and inserts data to your database tables desired. For more information about xml performance please see Chapter 9 — Improving XML Performance[^]
If it is impossible by CLR disabled directive due to your server policy you should create stand-alone app which does the same as CLR stored procedure or user defined function.


使用MS SQL Server Integration Services [SSIS]。它非常简单,工作效率很高。



问候,

Dinesh Kumar.V。
Use MS SQL Server Integration Services [SSIS]. It is very easy and does the work efficiently.

Regards,
Dinesh Kumar.V.


这篇关于从xml文件sql server 2008读取数据和插入的最快方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆