sqlserver把查询结果转为json和xml
SELECT [type],[desc] FROM #type FOR JSON PATH GO
SELECT [type],[desc] FROM #type WHERE [type] LIKE '%F%' FOR JSON PATH,ROOT('DB Type') GO
select userName,age from UserInfoes where userId=8 for xml path('user')
SELECT [type],[desc] FROM #type FOR JSON PATH GO
SELECT [type],[desc] FROM #type WHERE [type] LIKE '%F%' FOR JSON PATH,ROOT('DB Type') GO
select userName,age from UserInfoes where userId=8 for xml path('user')