易截截图软件、单文件、免安装、纯绿色、仅160KB

SQLServer2005分解并导入xml文件

  SQLServer2005分解并导入xml文件 收藏
测试环境SQL2005,windows2003
DECLARE @idoc int;
DECLARE @doc xml;
 
SELECT @doc=bulkcolumn from OPENROWSET(
   BULK 'D: \test.xml',
   SINGLE_BLOB) AS x
 
EXEC sp_xml_preparedocument @Idoc OUTPUT, @doc
 
 SELECT * into #temp from OPENXML (@Idoc, '/Root/Item',2)
   WITH (
            [ID] varchar(10)
           ,[Name]varchar(10)
           ,[Caption]varchar(10)
         )
select * from #temp
drop table #temp
/**//*--文件D: est.xml的文本内容
<?xml version="1.0" encoding="UTF-8"?>
<Root>
  <Item>
    <ID>1</ID>
    <Name>jinjazz</Name>
    <Caption>剪刀</Caption>
  </Item>
  <Item>
    <ID>2</ID>
    <Name>zswang</Name>
    <Caption>伴水</Caption>
  </Item>
</Root>
*/
/**//*---查询结果
ID         Name       Caption
---------- ---------- ----------
1          jinjazz    剪刀
2          zswang     伴水
*/
 
 


相关文档:

XML格式转化工具类

基于dom4j的XML格式转化类
package com.lixi.util;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import org.dom4j.Document;
import org.do ......

10本经典XML及Web相关电子书


XML How to Program

Beginning Xml Databases

Beginning XSLT and XPath Transforming XML Documents and Data

ASP.NET 2.0 XML

XML 手册 4th Edition

XML Schema Complete Reference
......

如何 使用 java 操纵 XML 文件


Introduction to XML and XML With Java  
 
If you are looking for sample programs to parse a XML file using DOM/SAX parser or looking for a program to generate a XML file please proceed directly to programs.
This small tutorial introduces you to the basic concepts of XML and using Xer ......

JAVA 中用XML实现INI文件格式的解决方案

        这篇文章被转载的次数最多,其实代码简陋得我自己都看不下去。只不过发表这篇文章时很多人需要这个功能。
     
      这几天写个数据库查询分析器,要用到XML记录用户注册的数据库连接地址、端口等信息,最开始想用java ......

android xml dom解释

private
NodeList root(
final
String url , 
final
String str){
      
NodeList root =
null
;
      
try
{
      
InputSource is=
new
InputSource(
new
InputStreamReader(
new
UR ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号