How To Store Formatted paragraph in SQL Server

Jayant Chawda 1 Reputation point
2022-08-08T07:38:52.383+00:00

Hii
I have I Formated Email and Email Contain Paragraph ,Html Body,tables So How i save All things in SQL Server In Future Directly Show the email Or things

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,708 questions
SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,799 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,452 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ronen Ariely 15,096 Reputation points
    2022-08-08T08:45:30.657+00:00

    Good day @Jayant Chawda

    Your description is not clear at all. I will try to guess what you asked for and if this does not solve your issue then please try to elaborate the issue using a tool to help you with the English if needed (you can use Google translator).

    I have I Formated Email and Email Contain Paragraph ,Html Body,tables So How i save All things in SQL Server In Future Directly Show the email Or things

    Option 1: If you ask about how to store the information related to email in SQL Server database, then the solution is to create a table with columns that fit your data and use queries to store the data in the table. For this task, you can use a tool named SQL Server Management Studio (SSMS).

    To learn more about queries and how to store data and get the data, you can go over this tutorial:
    https://www.w3schools.com/sql/

    Option 2: If you are asking how to send email from SQL Server using HTML format, then you can use the built-in stored procedure sp_send_dbmail. Sample C show you how to send formatted email using HTML code.

    https://learn.microsoft.com/sql/relational-databases/system-stored-procedures/sp-send-dbmail-transact-sql?view=sql-server-ver16&WT.mc_id=DP-MVP-5001699#c-sending-an-html-e-mail-message

    I hope this cover your needs

    0 comments No comments

  2. Erland Sommarskog 101K Reputation points MVP
    2022-08-08T21:38:26.37+00:00

    You store the data as-is. If it is text-based markup, you store it in nvarchar(MAX). If it is binary like a Word doument, you use the data type varbinary(MAX). In either case, interpretation is up to the client. SQL Server is only an unintelligent data store.

    0 comments No comments

  3. YufeiShao-msft 7,056 Reputation points
    2022-08-09T07:25:22.813+00:00

    Hi @Jayant Chawda ,

    sp_send_dbmail system stored procedure has one feature, it can send email in HTML format, you can try to pass the whole HTML string to sp_send_dbmail's @Tomas Podoba parameter and send the email.

    Generate HTML Formatted Emails from SQL Server

    You also can use SSIS script task to send email,


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.