摘要:
For XML Path 语句可以将查询的数据集生成XML格式.通过简单的XPath语法来允许用户自定义嵌套的XML结构、元素、属性值.基础语法: select * from tablename for xml path ('node name' ) (可以自定义XML的节点名称).1.创建测试数据表和数据的脚本--1.Create tableif exists (select 1 from sysobjects where id = object_id('tbOrder') and type = 'U')DROP TABLE tbOrdergo 阅读全文