mysql equivalent data types(mysql 等效数据类型)
问题描述
我来自 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
推荐答案
Going by http://msdn.microsoft.com/en-us/library/ms186939.aspx,我会说
Going by http://msdn.microsoft.com/en-us/library/ms186939.aspx, I would say that
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 等效数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:mysql 等效数据类型
基础教程推荐
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
