代码如下: DECLARE @TempTable table(UserID int , UserName nvarchar(50)); insert into @TempTable (UserID,UserName) values (1,'a') insert into @TempTable (UserID,UserName) values (2,'b') select UserID,UserName from @TempTable FOR XML PATH 运行这段脚本,将生成如下结果: 代码如下: row UserID1/UserID UserNamea/UserName /row row UserID2/UserID UserNameb/UserName /r...
[ 查看全文 ]