Jump to content
Sign in to follow this  
rhishi20

HTML Mail generation through SQL server

Recommended Posts

Dear Friends , I am just going through SQL Stored Procedure which is previously created. it contains mail Generation in HTML through SQL. in following code i am not able to understand use of number (1) & (2) please explain me. ----------------------------------------------------------------------------------------------------------------------SET @tableHTML = N'<H>MRP Indent Details</H>' + N'<table border="1">' + N'<tr><th>Indent Code</th><th>Indent Date</th><th>indent Type</th>' + N'<th>Approved BY</th><th>Cost center</th><th>No Of Items</th><th>Approximate Rate</th></tr>'+ CAST ((select td=a.Indentcd,' ', (1) ' ' td=a.IndentDt,'', td=a.indenttype,' ', td=a.ApprovedBy,' ', td=a.ccncd,' ', "td/@align" = 'right',td=a.Itemcnt,' ', "td/@align" = 'right',td=a.mthwtavgrate,' ' from TmpMRPMail a FOR XML PATH('tr'), TYPE ) AS NVARCHAR(MAX)) + N'</table>' ; (2) XML Path -----------------------------------------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Both of those lines are part of the same cast statement, is cast what you don't understand?

Share this post


Link to post
Share on other sites

I'm not sure, but maybe they are selecting blank values or spaces to match a certain column structure or something similar.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...