Method 1:
SELECT *
FROM dbo.YourStudentTable
FOR XML PATH('Student'), ROOT ('Students')
Method 2:
DECLARE @x xml
SET @x=( SELECT *
FROM dbo.YourStudentTable FOR XML RAW, TYPE,ROOT('myRoot'))
SELECT @x
Method 3:
SELECT * from dbo.YourStudentTable
FOR XML RAW ('Employee'), ROOT ('Employees'), ELEMENTS XSINIL;
SELECT *
FROM dbo.YourStudentTable
FOR XML PATH('Student'), ROOT ('Students')
Method 2:
DECLARE @x xml
SET @x=( SELECT *
FROM dbo.YourStudentTable FOR XML RAW, TYPE,ROOT('myRoot'))
SELECT @x
Method 3:
SELECT * from dbo.YourStudentTable
FOR XML RAW ('Employee'), ROOT ('Employees'), ELEMENTS XSINIL;
No comments:
Post a Comment