For XML路径如何在后台工作? [英] How For XML path works behind the scene?

查看:81
本文介绍了For XML路径如何在后台工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

谁能告诉我xml子句如何在幕后工作,例如以下查询:

Hi Everyone,

Can anyone please tell me how for xml clause works behind the scenes like the following query:

select stuff((select ','+ename from emppck for xml path('')),1,1,'') 


上面的一个产生结果集,用逗号分隔ename值(1行).

幕后到底发生了什么,数据库引擎在这里扮演什么角色.请对此发表评论.

问候
Chaithanya M


Above one produces resultset as the comma seperated of ename values (1 row).

What exactly is happening behind the scene, what role the database engine has here. Please comment on this.

Regards
Chaithanya M

推荐答案

SQL Server 2005识别XML数据类型列. PATH方法允许将类似XPath的表达式用作列名.查看两个链接以获取更多信息.

http://msdn.microsoft.com/en-us/library/ms345117%28v = sql.90%29.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/ms345137%28v = sql.90%29.aspx [ ^ ]

祝你好运!
SQL Server 2005 recognizes XML data type columns. The PATH method allows for XPath like expression as a column name. Have a look at both links for more info.

http://msdn.microsoft.com/en-us/library/ms345117%28v=sql.90%29.aspx[^]

http://msdn.microsoft.com/en-us/library/ms345137%28v=sql.90%29.aspx[^]

Good luck!


这篇关于For XML路径如何在后台工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆