<bdo id='4VxCk'></bdo><ul id='4VxCk'></ul>

    <legend id='4VxCk'><style id='4VxCk'><dir id='4VxCk'><q id='4VxCk'></q></dir></style></legend>

      <i id='4VxCk'><tr id='4VxCk'><dt id='4VxCk'><q id='4VxCk'><span id='4VxCk'><b id='4VxCk'><form id='4VxCk'><ins id='4VxCk'></ins><ul id='4VxCk'></ul><sub id='4VxCk'></sub></form><legend id='4VxCk'></legend><bdo id='4VxCk'><pre id='4VxCk'><center id='4VxCk'></center></pre></bdo></b><th id='4VxCk'></th></span></q></dt></tr></i><div id='4VxCk'><tfoot id='4VxCk'></tfoot><dl id='4VxCk'><fieldset id='4VxCk'></fieldset></dl></div>
    1. <small id='4VxCk'></small><noframes id='4VxCk'>

    2. <tfoot id='4VxCk'></tfoot>
      1. 在 SQL Server 中存储 HTML

        Storing HTML in SQL Server(在 SQL Server 中存储 HTML)

          <i id='6nuS0'><tr id='6nuS0'><dt id='6nuS0'><q id='6nuS0'><span id='6nuS0'><b id='6nuS0'><form id='6nuS0'><ins id='6nuS0'></ins><ul id='6nuS0'></ul><sub id='6nuS0'></sub></form><legend id='6nuS0'></legend><bdo id='6nuS0'><pre id='6nuS0'><center id='6nuS0'></center></pre></bdo></b><th id='6nuS0'></th></span></q></dt></tr></i><div id='6nuS0'><tfoot id='6nuS0'></tfoot><dl id='6nuS0'><fieldset id='6nuS0'></fieldset></dl></div>
        • <legend id='6nuS0'><style id='6nuS0'><dir id='6nuS0'><q id='6nuS0'></q></dir></style></legend>

                <small id='6nuS0'></small><noframes id='6nuS0'>

                • <bdo id='6nuS0'></bdo><ul id='6nuS0'></ul>
                    <tbody id='6nuS0'></tbody>
                  <tfoot id='6nuS0'></tfoot>
                  本文介绍了在 SQL Server 中存储 HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我应该使用什么数据类型在 SQL Server 2008 中存储 HTML 内容?

                  用于 CMS 的动态内容.

                  解决方案

                  VARCHAR(MAX) 如果一切都基于 ascii,比如基本的 HTML 模板

                  NVARCHAR(MAX) 如果 HTML 可以包含任何内容

                  NVARCHAR 将使您的存储使用量增加一倍,因为它使用的空间量是 VARCHAR 的两倍.HTML 本身不需要 NVARCHAR,只有 HTML 标签之间的内容可以基于语言等.

                  从给出这个答案多年后,如果标签内容之间有任何内容,我现在几乎总是使用 NVARCHAR.Unicode 流行...

                  我只在存储简单的 html 模板时才使用 VARCHAR,例如标签和占位符
                  例如:

                  [PLACEHOLDER]

                  根据您的用例拨打电话..

                  What data type should I use to store HTML content in SQL Server 2008?

                  It's for dynamic content for a CMS.

                  解决方案

                  VARCHAR(MAX) if it's all going to be ascii-based, say for basic HTML tepmplates

                  NVARCHAR(MAX) if the HTML could contain any content

                  NVARCHAR will double your storage use as it uses double the amount of space as VARCHAR. HTML itself does not require NVARCHAR, only the content in-between the HTML tags could based on the language, etc..

                  Edit:

                  Many years on from giving this answer I almost always use NVARCHAR now if there is any between the tag content. Unicode is popular...

                  I only use VARCHAR if just storing simple html templates, eg tags and placeholders
                  eg: <div><span>[PLACEHOLDER]</span><div>

                  Make the call based on your use-case..

                  这篇关于在 SQL Server 中存储 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How do I split flat file data and load into parent-child tables in database?(如何拆分平面文件数据并加载到数据库中的父子表中?)
                  Import / Export database with SQL Server Server Management Studio(使用 SQL Server Server Management Studio 导入/导出数据库)
                  How do you import a large MS SQL .sql file?(如何导入大型 MS SQL .sql 文件?)
                  SQL variable to hold list of integers(用于保存整数列表的 SQL 变量)
                  Crystal Reports vs. Microsoft SQL Server Reporting Services(Crystal Reports 与 Microsoft SQL Server Reporting Services)
                  The report definition has an invalid target namespace rsInvalidReportDefinition(报告定义具有无效的目标命名空间 rsInvalidReportDefinition)

                  <legend id='qa92p'><style id='qa92p'><dir id='qa92p'><q id='qa92p'></q></dir></style></legend>

                    <tbody id='qa92p'></tbody>
                  <tfoot id='qa92p'></tfoot>
                • <small id='qa92p'></small><noframes id='qa92p'>

                    • <bdo id='qa92p'></bdo><ul id='qa92p'></ul>

                      <i id='qa92p'><tr id='qa92p'><dt id='qa92p'><q id='qa92p'><span id='qa92p'><b id='qa92p'><form id='qa92p'><ins id='qa92p'></ins><ul id='qa92p'></ul><sub id='qa92p'></sub></form><legend id='qa92p'></legend><bdo id='qa92p'><pre id='qa92p'><center id='qa92p'></center></pre></bdo></b><th id='qa92p'></th></span></q></dt></tr></i><div id='qa92p'><tfoot id='qa92p'></tfoot><dl id='qa92p'><fieldset id='qa92p'></fieldset></dl></div>