Printing table contents for debugging purposes in T-SQL
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…