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

推荐订阅源

Google DeepMind News
Google DeepMind News
C
Check Point Blog
GbyAI
GbyAI
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
Hacker News - Newest:
Hacker News - Newest: "LLM"
V2EX - 技术
V2EX - 技术
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
F
Full Disclosure
S
Secure Thoughts
WordPress大学
WordPress大学
博客园 - Franky
N
News and Events Feed by Topic
雷峰网
雷峰网
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
N
Netflix TechBlog - Medium
Forbes - Security
Forbes - Security
TaoSecurity Blog
TaoSecurity Blog
C
CERT Recently Published Vulnerability Notes
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
Security Latest
Security Latest
Attack and Defense Labs
Attack and Defense Labs
The Register - Security
The Register - Security
Spread Privacy
Spread Privacy
H
Help Net Security
宝玉的分享
宝玉的分享
L
LangChain Blog
MongoDB | Blog
MongoDB | Blog
I
Intezer
Schneier on Security
Schneier on Security
Latest news
Latest news
Y
Y Combinator Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
InfoQ
A
About on SuperTechFans
T
Tor Project blog
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
Microsoft Azure Blog
Microsoft Azure Blog
T
Threat Research - Cisco Blogs
S
Schneier on Security
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog

博客园 - 南柯之石

用户中心 - 博客园 自引用泛型模式分析 一定间隔时间下重复执行一个函数的几个方法 为什么.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)  评论()    收藏  举报