OPENXML (Transact-SQL)

OPENXML provides a rowset view over an XML document. Because OPENXML is a rowset provider, OPENXML can be used in Transact-SQL statements in which rowset providers such as a table, view, or the OPENROWSET function can appear.

https://docs.microsoft.com/en-us/sql/t-sql/functions/openxml-transact-sql?view=sql-server-2017

https://docs.microsoft.com/en-us/sql/relational-databases/xml/examples-using-openxml?view=sql-server-2017

XML System Stored Procedures

SQL Server provides the following system stored procedures that are used together with OPENXML:

  • sp_xml_preparedocument (Transact-SQL)

  • sp_xml_removedocument (Transact-SQL)

    To write queries by using OPENXML, you must first create an internal representation of the XML document by calling sp_xml_preparedocument. The stored procedure returns a handle to the internal representation of the XML document. This handle is then passed to OPENXML. OPENXML provides rowset views of the document based on XPaths. Specifically, this is one row pattern and one or more column patterns.

Note

The document handle that is returned by sp_xml_preparedocument is valid for the duration of the session.

The internal representation of an XML document can be removed from memory by calling the sp_xml_removedocument system stored procedure.

已经不建议用这个

https://stackoverflow.com/questions/49272564/openxml-returning-null

https://stackoverrun.com/cn/q/1573581

openxml in sql server的更多相关文章

  1. SQL Server XML转Table

    前言 在SQL Server中有时候我们需要传人一个Table过去,然后可以在存储过程中批量更新,批量的获取相应数据. 但存储过程的参数是固定,所以这里我们可以变通的传人xml类型的参数,然后在存储过 ...

  2. SQL Server :Stored procedures存储过程初级篇

    对于SQL Server,我是个拿来主义.很多底层的原理并不了解,就直接模仿拿着来用了,到了报错的时候,才去找原因进而逐步深入底层.我想,是每一次的报错,逼着我一点点进步的吧. 近期由于项目的原因,我 ...

  3. 转载--SQL Server 2005的XQuery介绍

    原文地址: http://bbs.51cto.com/thread-458009-1-1.html   引用: 摘要 本文介绍了SQL Server 2005能够支持的XQuery的各方面特性如FLW ...

  4. 快速批量导入庞大数据到SQL SERVER数据库(ADO.NET)

    原文地址:http://www.cnblogs.com/chenxizhang/archive/2008/11/11/1331060.html 如果你需要在程序中批量插入成千上万行的数据,你会怎么编写 ...

  5. Querying Microsoft SQL Server 2012 读书笔记:查询和管理XML数据 1 -使用FOR XML返回XML结果集

    XML 介绍 <CustomersOrders> <Customer custid="1" companyname="Customer NRZBB&qu ...

  6. SQL Server存储过程 对数组参数的循环处理

    方法一 分割 例:通过SQL Server存储过程传送数组参数删除多条记录 eg. ID 值为'1,2,3' 以下存储过程就是删除表中id号为1,2,3的记录: CREATE PROCEDURE De ...

  7. 轻松学SQL Server数据库

    轻松学SQL Server数据库pdf   下载地址:网盘下载 目录:  第1章 数据库与SQL Server 2008 11.1 数据库基础 21.1.1 数据库的概念 21.1.2 数据库模型 2 ...

  8. 《SQL Server 2008从入门到精通》--20180704

    XML查询技术 XML文档以一个纯文本的形式存在,主要用于数据存储.不但方便用户读取和使用,而且使修改和维护变得更容易. XML数据类型 XML是SQL Server中内置的数据类型,可用于SQL语句 ...

  9. SQL SERVER常用语法汇总

    阅读目录 一.SQL分类 二.基础语句 三.sql技巧 四.(MS SQL Server)SQL语句导入导出大全 回到目录 一.SQL分类 DDL—数据定义语言(CREATE,ALTER,DROP,D ...

随机推荐

  1. CU论坛常用知识点汇总

    1.正则表达式详解 http://bbs.chinaunix.net/thread-63273-1-1.html http://bbs.chinaunix.net/thread-605570-1-1. ...

  2. java环境配置——jdk8

    在官网下载最新版本的jdk 测试版本:jdk-8u60-windows-x64.exe 测试环境:Windows Server 2012 R2 Standard  X64 开始执行安装 安装过程中会选 ...

  3. BeautifulSoup实例

    Beautiful Soup 4.4.0 中文文档:http://beautifulsoup.readthedocs.io/zh_CN/latest/ #coding:utf-8from bs4 im ...

  4. 大数据学习——securecrt同时向多个tab窗口发送相同的命令

    右键选中 然后在下面空白窗口写命令就可以了

  5. spring用到的设计模式

    https://www.cnblogs.com/yuefan/p/3763898.html https://www.cnblogs.com/hwaggLee/p/4510687.html https: ...

  6. loadRunner之参数化,对用户名和密码进行参数化,并打印输出---实际操作:用户登录的账号用随机值来登录

    录制脚本,对用户名和密码进行参数化: Action() { web_url("WebTours", "URL=http://127.0.0.1:1080/WebTours ...

  7. Leetcode 289.生命游戏

    生命游戏 根据百度百科,生命游戏,简称为生命,是英国数学家约翰·何顿·康威在1970年发明的细胞自动机. 给定一个包含 m × n 个格子的面板,每一个格子都可以看成是一个细胞.每个细胞具有一个初始状 ...

  8. OSPF选路原则

    1:O路由>Oia路由>external路由! O:计算LSA-1和LSA-2,前提age不能MaxAge,metric不能LSinfinity,计算出来的最小metric的路由放入RIB ...

  9. 【HDOJ6308】Time Zone(模拟)

    题意: 以"UTC+X'', "UTC-X'', "UTC+X.Y'', or "UTC-X.Y'' 四种格式给定当地时间,要求转换为北京时间 思路:Gold_ ...

  10. linux 常见名词及命令(二)

    pwd 用于显示当前的工作目录. cd 用于切换工作路径 cd - 切换到上一次的目录 cd ~ 切换到家目录 cd ~username 切换到其他用户的家目录 cd .. 切换到上级目录 ls 用于 ...