Database.SQL Server provide FOR XML Clause. For XML clause returns result of
query as XML.There are some options with FOR XML clause
- Raw
- Path
- Elements(can be used with raw,auto,path)
- Explicit
find all differences from below query output
[dbo].[emp](
[PRIMARY]
emp (emp_id,emp_name) values
- select *from dbo.emp for xml raw
- select *from dbo.emp for xml raw,elements
- select *from dbo.emp for xml auto
- select *from dbo.emp for xml auto,elements
- select *from emp for xml auto
/>
- select *from emp for xml path('uma')