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. jquery的ajax和getJson跨域获取json数据

    目前浏览器端跨域访问常用的两种方法有两种: 1.通过jQuery的ajax进行跨域,这其实是采用的jsonp的方式来实现的. jsonp是英文json with padding的缩写.它允许在服务器端 ...

  2. 【树状数组+dp】HDU 5542 The Battle of Chibi

    http://acm.hdu.edu.cn/showproblem.php?pid=5542 [题意] 给定长为n的序列,问有多少个长为m的严格上升子序列? [思路] dp[i][j]表示以a[i]结 ...

  3. X230 安装 EI Capitan 10.11.5 驱动篇

    /* 键盘又换回了 美蓓亚键盘 缩写nmb    虽然比群光软 但是手感真的出色,貌似x宝没有这个代工厂的键盘(全新,非拆机,而且是标准us阵列,背光版) 有人肯定会问,博主这么纠结键盘干嘛?     ...

  4. lubuntu通过Smb访问Windows共享目录

    lubuntu通过Smb访问Windows共享目录 如果未安装Smb,先安装: apt-get install smbclient smbfs 安装后,查看共享主机上的共享目录: CentOS/Red ...

  5. jquery serializeArray() 方法通过序列化表单值来创建对象数组(名称和值)。

    serializeArray() 方法序列化表单元素(类似 .serialize() 方法),返回 JSON 数据结构数据. html代码: <form> <div><i ...

  6. 某考试 T1 至危警告

    题目大意就是: 设f(x)为x各个位数字之和,求x属于[0,k]且b * f(x)^a + c = x的x个数并升序输出. (a<=5  .  b,c,<=10^4  .   k<= ...

  7. 一次使用NodeJS实现网页爬虫记

    前言 几个月之前,有同事找我要PHP CI框架写的OA系统.他跟我说,他需要学习PHP CI框架,我建议他学习大牛写的国产优秀框架QeePHP. 我上QeePHP官网,发现官方网站打不开了,GOOGL ...

  8. [React] {svg, css module, sass} support in Create React App 2.0

    create-react-app version 2.0 added a lot of new features. One of the new features is added the svgr  ...

  9. Python 基础语法(和Java相比)

    Python变量和数据类型 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ...

  10. VC++ 2010编译错误 fatal error C1189 error This file requires _WIN32_WINNT to be #defined at least

    打开你的C++工程,找到里面的stdafx.h文件,然后把下面的红色内容替换成绿色的 参考:http://blog.csdn.net/dongliqiang2006/article/details/5 ...