Which datatype can be used for storing HTML files in database?

Since you want to store both the HTML of the web page as well as the images, you might want to consider storing the images in the file system instead. Here is a comparison of the advantages and disadvantages of both options:

  • Storing Images in DB - Yea or Nay?

If you decide to store them in the DB, the appropriate data types are:

  • nvarchar(MAX) for the HTML text and
  • varbinary(MAX) for the images.

I could store them in the DB, by

using nvarchar(MAX). it has stored the data as well as retrieved data with the image.

My objective was to copy and paste emails received. These emails can have HTML tags and can also have images. I tried it with nvarchar(max) and it worked.

I am using VB6 as a development tool. The only problem I found was I could not store it with stored procedures passing the values through addParameter.

I have stored it with traditional saving mechanism from VB6

With Recordset<br>
 .addnewM<br>
 .Fields("MailBody")<br>
 .Update<br>
End With<br>

If anyone gets idea of storing using the stored procedure, let me know