0

I am trying to convert the SQL result to HTML format. But the result only gives first 66 rows out of 17266. Can you please let me know what I missed.

declare @query nvarchar(max) 
set @query = N'<h1>BACKUP DATE</h1>'+  N'<style type=''text/css''>'+  N'table td,table th,table caption'+ N'table th{ background-color:3399FF;font-weight:bold; }'+  N'table caption { font-weight;bold;background-color:white; }'+  N'</style>'+  N'<table>'+  N'<caption>BDATE</caption>'+  N'<tr><th>DBNAME</th> <th>FDATE</th></tr>'+ cast(( SELECT td=NAME ,'',td=FDATE FROM TEMP  for xml path('tr'),type) as nvarchar(max)) +N'</table>'  select @query
vijay kumar
  • 203
  • 1
  • 6
  • 16

1 Answers1

0

Here is a similar link, maybe you have not declared the output as nvarchar(max)?

Convert a SQL query result table to an HTML table for email

Community
  • 1
  • 1
Satheesh Variath
  • 680
  • 4
  • 10