mysql等效数据类型 [英] mysql equivalent data types
问题描述
我来自SQL Server背景.在MySQL中,以下等价数据类型将是什么:
I'm coming from a SQL Server background. What would the equivalent data types be for the following in MySQL:
NVARCHAR
-支持所有语言的国际多字节字符
NVARCHAR
- provides support for international, multi-byte characters for all languages
NVARCHAR(max)
-允许很长的文本文档
NVARCHAR(max)
- allows for very long text documents
推荐答案
http://msdn.microsoft.com/zh-cn/library/ms186939.aspx ,我会说
VARCHAR(n) CHARSET ucs2
是最接近的等效项.但是我看不到有很多人使用它,而更多人使用:
is the closest equivalent. But I don't see many people using this, more often people use:
VARCHAR(n) CHARSET utf8
据我所知,字符集utf8和ucs2允许使用相同的字符,只是编码有所不同.因此,任何一种都应该起作用,并且我可能会选择后者,因为它的使用频率更高.
As far as I am aware, both charactersets utf8 and ucs2 allow for the same characters, only the encoding is different. So either one should work, and I would probably go for the latter since it is used more often.
MySQL的unicode支持存在一些限制,这些限制可能适用于您的用例,也可能不适用于您的用例.请参考 http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html 了解有关MySQL的unicode支持的更多信息.
There are some limitations in MySQL's unicode support that may or may not apply to your use case. Please refer to http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html for more info on MySQL's unicode support.
这篇关于mysql等效数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!