Friday, February 24, 2012

How to store HTML data in SQL

Hi friends

I want to add HTML to the SQL server as data please can anyone help me. which data type . & how to store the data.

Thanks for all your support

Thanks & regards

ASPFreak

You can use a TEXT type or BLOB. I would personally use gzip to compress the string before storing it and uncompressed when retrieving.

Hope this helps

|||

Do you know or expect the amount of HTML you will have? If yes, then user varchar or nvarchar. If not, use text or ntext.

How to store them? Treat them as notmal text.

Example:

1Insert into MyTable (PageNumber, PageName , HTML)2 Values (1 ,'Index.html','<p>This is a sample</p>')3

Good luck.

|||

What approach did you take?

No comments:

Post a Comment