다음과 비슷하게 도움말에 나온다.
declare 
	@tablehtml  nvarchar(max);
	
set @tablehtml =
	N'<h1>제목</h1>' +
	N'<table border="1">' +
	N'<tr>' +
	
	N'<th>table_schema</th>' + 
	N'<th>table_name</th>' +

	'</tr>' +
	cast (( 
		select 
			td = table_schema, ''
		,	td = table_name
		from information_schema.tables 
			for xml path('tr'), type 
	) as nvarchar(max)) +
	N'</table>';
select @tablehtml;	
Retrieved from http://w.databaser.net/moniwiki/wiki.php/쿼리결과를Html로만들기
last modified 2018-04-13 23:12:52