易截截图软件、单文件、免安装、纯绿色、仅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     伴水
*/
 
 


相关文档:

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
......

xml格式获取值

function getkeyvalue(s_keyname,s_keystr)
s_keybegin="<"+s_keyname+">"
s_keyend="</"+s_keyname+">"
s_i_begin=instr(s_keystr,s_keybegin)
s_i_end=instr(s_keystr,s_keyend)
if s_i_end<=s_i_begin+len(s_keybegin) then
getkeyvalue=""
exit function
else
getkeyvalue=mid(s_k ......

如何 使用 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 ......

SQLServer获取Excel中所有Sheet

E盘根目录新建一个Excel文件aa.xls后测试如下代码
use tempdb
go
if (object_id ('udf_getExcelTableNames' ) is not null )
    drop function dbo .udf_getExcelTableNames
go
create function udf_getExcelTableNames (@filename varchar (1000 ))
returns @t table (id int , name varchar ( ......

SQLServer中的循环批处理

if (object_id ('t' ) is not null ) drop table t
go
create table t (id int identity (1 , 1 ), name varchar (40 ))
go
insert into t (name ) select newid ()
go 10
select * from t
/*
1    18C1C418-9029-4599-8D5E-616354A113C8
2    A0FE1177-09D8-4C56-9FB5-C2FA ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号