Ok so i have a job that runs with 4 separate select queries in it.
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Database Email',
@recipients = 'dbcheck@xxx.com',
@subject = 'SQL Replication Deletion Check',
@query = ''SELECT '\\server1\folder1\SQL\check.sql''
SELECT '' ''
SELECT ''1''
SELECT * FROM [repserv].[dbo].[1repdupecheck]
SELECT '' ''
SELECT ''2''
SELECT * FROM [repserv].[dbo].[2repdupecheck]
SELECT '' ''
SELECT ''3''
SELECT * FROM [repserv].[dbo].[3repdupecheck]
SELECT '' ''
SELECT ''4''
SELECT * FROM [repserv].[dbo].[4repdupecheck]',
@attach_query_result_as_file = 0,
@query_result_no_padding = 1,
@query_result_header = 0;
Currently it outputs as text quite nicely like so.
\\server1\folder1\SQL\check.sql
1
1820 '45074',
1854 '45074',
1822 '45488',
2
1819 '45074',
1853 '45074',
1851 '45488',
3
1871 '43971',
1873 '43971',
1875 '44429',
4
1842 '42729',
1857 '42729',
1870 '43971',
However I would like it to be in table format so I can highlight a column of data at a time easily.
I understand this can be done with HTML, is this the only way possible, if so how would i go about doing this?