惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Spread Privacy
Spread Privacy
A
Arctic Wolf
T
Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
Cyberwarzone
Cyberwarzone
博客园 - Franky
V2EX - 技术
V2EX - 技术
The Hacker News
The Hacker News
量子位
TaoSecurity Blog
TaoSecurity Blog
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
Scott Helme
Scott Helme
D
DataBreaches.Net
T
Troy Hunt's Blog
T
Threat Research - Cisco Blogs
美团技术团队
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
D
Docker
C
Check Point Blog
G
GRAHAM CLULEY
H
Heimdal Security Blog
IT之家
IT之家
博客园 - 叶小钗
The Cloudflare Blog
H
Help Net Security
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Security Archives - TechRepublic
Security Archives - TechRepublic
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
I
Intezer
P
Proofpoint News Feed
S
Security Affairs
P
Privacy International News Feed
U
Unit 42
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
N
News and Events Feed by Topic
Know Your Adversary
Know Your Adversary
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

博客园 - 南柯之石

用户中心 - 博客园 自引用泛型模式分析 一定间隔时间下重复执行一个函数的几个方法 为什么.NET Framework就没有个专门的P/Invoke Library? Which would you perfer? "easy and fast and works well" or "hard and time consuming and error prone" 在ListView的GroupItem头中显示每列的Summary 小例子背后的大道理——用户需求+设计原则+正确应用 =设计方案 GET和POST有什么区别?及为什么网上的多数答案都是错的。 小例子背后的大道理——Adapter模式详解 小例子背后的大道理——从DIP中“倒置”的含义说接口的正确使用 XmlSerializer, DataContractSerializer 和 BinaryFormatter区别与用法分析 使用WPF开发的扫雷游戏,双系统主题复刻版 技术误用带来的技术偏见及所谓的“经验” 从一个UI交互设计师的讲座说开去 NoSQL和MemeryCache的出现意味着传统数据库使用方式的变革吗? 不使用反射进行C#属性的运行时动态访问 一次模块划分的争论及其结局 电子书籍质量保证事件分析 在SQL Server中调用.NET程序集
T-SQL 操作XML示例
南柯之石 · 2011-11-29 · via 博客园 - 南柯之石

看MSND好长

CREATE TABLE XMLTable
(
    ID int primary key,
    Data xml,
)

INSERT INTO XMLTable (ID, Data) Values (1'<entity><id>1</id><name>name</name></entity>')

Select Data.query('/entity/name/text()')
FROM XMLTable WHERE Data.value('(/entity/id)[1]''int'= 1

-- Perform the same function

Select Data.value('(/entity/name/text())[1]''nvarchar(max)')
FROM XMLTable WHERE Data.value('(/entity/id)[1]''int'= 1

-- Much faster
Select Data.value('(/entity/name/text())[1]''nvarchar(max)')
FROM XMLTable WHERE Data.exist('/entity/id/text()="1"'= 1

-- The grammar is so ugly.
Update XMLTable Set Data.modify('replace value of (/entity/name/text())[1] with "UpdatedName"')

posted on 2011-11-29 20:06  南柯之石  阅读(529)  评论()    收藏  举报