23 August, 2013
0 Comments
1 category
Sometimes you just want to add a print statement in a stored procedure to output the contents of a table.
Then you can use the "FOR XML" statement in T-SQL:
declare @Data_as_xml xml set @Data_as_xml = (select top 4 * from sys.tables FOR XML PATH('')) print convert(varchar(8000), @Data_as_xml)
Result:
Tags: T-SQL
Category: Uncategorized