# Miscellaneous > Database Design >  Storing HTML in an SQL Database

## mark

Anybody have a clue how to store HTML in an SQL database?
I get errors trying to put the HTML text into a text datatype field....

Please send replies via email.

mark@ntshop.net

----------


## Tim Brooks

Mark,

Just store it in the db as HTML--SQL doesn&#39;t care what the data is right?

Then, when you want to out put it into your page use the HTMLEncode command:

<%
&#39;From your recordset
myHTML = RS(&#34;theHTML&#34 :Wink: 
%>
This is HTML output <%=Server.HTMLEncode(myHTML)%>


Hope this helps...
Tim


------------
mark at 6/26/99 12:39:04 PM


Anybody have a clue how to store HTML in an SQL database?
I get errors trying to put the HTML text into a text datatype field....

Please send replies via email.

mark@ntshop.net

----------


## Tim

I really don&#39;t see why you would do so, but I insert HTML all the time in memo fields for guest books in Access.. Make sure your insert statment use&#39;s the replace function if your inserting into the database from ASP.. If someone insert&#39;s &#34;Mc&#39;Guinn&#34; for instance, this can mess up your query.. Don&#39;t know if that&#39;s what you mean, but otherwise the database shouldn&#39;t care what type of text you store


------------
Tim Brooks at 10/1/99 9:19:05 AM

Mark,

Just store it in the db as HTML--SQL doesn&#39;t care what the data is right?

Then, when you want to out put it into your page use the HTMLEncode command:

<%
&#39;From your recordset
myHTML = RS(&#34;theHTML&#34 :Wink: 
%>
This is HTML output <%=Server.HTMLEncode(myHTML)%>


Hope this helps...
Tim


------------
mark at 6/26/99 12:39:04 PM


Anybody have a clue how to store HTML in an SQL database?
I get errors trying to put the HTML text into a text datatype field....

Please send replies via email.

mark@ntshop.net

----------

