Re: How to store HTML code in SQL server table

From: Jeffrey Palermo [MCP] (http://dotnetjunkies.com/weblog/jpalermo)
Date: 11/30/04


Date: Mon, 29 Nov 2004 18:39:17 -0600

Wayne,
    Maybe it's just a typo, but varchar cannot be properly used with unicode
and has a maximum length of 8000 characters. nvarchar has a limit of 4000
characters and should be used for all applications for maintenance purposes
(since most applications will have to support unicode in the future).

-- 
Best regards,
Jeffrey Palermo
Blog: http://dotnetjunkies.com/weblog/jpalermo
"Wayne Snyder" <wayne.nospam.snyder@mariner-usa.com> wrote in message
news:eL$4fPh1EHA.4004@tk2msftngp13.phx.gbl...
> As the other poster states, it is not SQL that is doing the encoding, it
is
> something else...
>
> Also, if the html pages will be less than 4000 unicode characters, you may
> prefer to strore the data in a varchar column.
>
> -- 
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
>
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "Peter Afonin" <pva@speakeasy.net> wrote in message
> news:eyXuQOa1EHA.3820@TK2MSFTNGP11.phx.gbl...
> > Hello,
> >
> > I'm creating something like a web site builder in ASP.Net, and I need to
> > store an HTML code in the SQL server table. If my customer just enters
an
> > HTML code, it is stored in the SQL server table like this: &lt;table
> > cellSpacing=&quot;0&quot; cellPadding=&quot;0&quot;
width=&quot;760&quot;
> > border=&quot;0&quot;&gt;, instead of <table cellSpacing="0"
> cellPadding="0"
> > width="760" border="0">
> >
> > This significantly increases the size of the stored code.
> >
> > Are there any conversion functions or something like this to avoid it?
> Where
> > this conversion should be done - in ASP.Net or SQL server? How do I
> convert
> > it back to create an HTML page?
> >
> > Please note that I must use the Unicode data type - ntext, nchar etc,
> since
> > I'm using some Cyrillic characters.
> >
> > I would appreciate your advice very much.
> >
> > Thank you,
> >
> > -- 
> > Peter Afonin
> >
> >
>
>


Relevant Pages

  • Re: How to store HTML code in SQL server table
    ... but varchar cannot be properly used with unicode ... and has a maximum length of 8000 characters. ... > I support the Professional Association of SQL Server and it's> community of SQL Server professionals. ... >> I'm creating something like a web site builder in ASP.Net, and I need to>> store an HTML code in the SQL server table. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to store HTML code in SQL server table
    ... but varchar cannot be properly used with unicode ... and has a maximum length of 8000 characters. ... > I support the Professional Association of SQL Server and it's> community of SQL Server professionals. ... >> I'm creating something like a web site builder in ASP.Net, and I need to>> store an HTML code in the SQL server table. ...
    (microsoft.public.sqlserver.programming)
  • Re: Access 2007 importing data with extended character sets.
    ... After creating a new database with nvarchar, etc., perhaps data conversion to Unicode will be the best route. ... Don't use Unicode outside the usual ASCII character set in your primary keys as there is a bug in ODBC drivers for SQL Server. ... In an SQL Server table connected to an Access MDB through ODBC, there can be an erroneous redundant translation between Unicode and ASCII characters, and the translation only happens on primary key. ...
    (microsoft.public.access.externaldata)
  • Re: nVarchar
    ... Unicode is required even if you're not using double-wide characters. ... Tibor Karaszi, SQL Server MVP ... >> The Insert and Update statements are below ...
    (microsoft.public.sqlserver.programming)
  • Re: Unicode Support
    ... >> (I know this is a poor example, but think about other languages, eg ... First things first, when you register your RosAsm windows classes, you ... the messages with ANSI / UNICODE parameters in ANSI or UNICODE form... ... with their alphabet characters, as with the numbers and punctuation...so, ...
    (alt.lang.asm)

Loading