Thursday, 1 September 2016

How to convert records in a table to XML format using T-SQL?

DECLARE @stSqlString NVARCHAR(MAX)  = ''

SET @stSqlString = 'set @stStrXml=(select *  from TableName FOR XML AUTO, elements)'
EXEC sp_executesql @stSqlString, N'@stStrXml XML OUTPUT',@stStrXml OUTPUT

 SELECT  @stStrXml

No comments:

Post a Comment

Row based styling for Primeng DataTable using Angualr 2,4

------------------------------------Component.Html---------------- < p -dataTable id = "Tbl" [ rowStyleClass ]= " Fu...