declare @body varchar(max) set @body = cast( ( select td = dbtable + '' + cast( entities as varchar(30) ) + '' + cast( rows as varchar(30) )
from (
select dbtable = object_name( object_id ),
entities = count( distinct name ),
rows = count( * )
from sys.columns
group by object_name( object_id )
) as d
for xml path( 'tr' ), type ) as varchar(max) )
set @body = '' + ' ' + replace( replace( @body, '<', '<' ), '>', '>' ) + '
Database Table | Entity Count | Total Rows |
---|
print @body
<html> <head > </head> <body> <body> <html>
http://stackoverflow.com/questions/7070053/convert-a-sql-query-result-table-to-an-html-table-for-email
this is awesome thank very helpfull
ReplyDeleteAsking questions are genuinely good thing if you are not understanding anything totally, however this post offers fastidious understanding even.
ReplyDelete