在SQL Server中存储HTML [英] Storing HTML in SQL Server

查看:1002
本文介绍了在SQL Server中存储HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是用于CMS的动态内容。

解决方案

VARCHAR(MAX)如果它们都是基于ascii的, / p>

如果HTML可以包含任何特殊字符(例如日语,阿拉伯语等),NVARCHAR(MAX) / p>

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


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 HTML with English content

NVARCHAR(MAX) if the HTML could contain any special charachters (eg. Japanese, Arabic, etc.)

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..

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆