for xml path(string)
1 select top 3 LoginId from Users for xml path ('')
结果: <LoginId>data1</LoginId>
<LoginId>data2</LoginId>
<LoginId>data3</LoginId>
2 select top 3 LoginId as [text()] from Users for xml path ('')
结果: data1data2data3
3 select top 3 LoginId as [text()] from Users for xml path ('ui')
结果: <ui>data1</ui>
<ui>data2</ui>
<ui>data3</ui>
4 select top 3 LoginId from Users for xml path ('ui')
结果: <ui>
<LoginId>data1</LoginId>
</ui>
<ui>
<LoginId>data2</LoginId>
</ui>
<ui>
<LoginId>data3</LoginId>
</ui>