我将超过 4000 个字符的字符串插入到 nvarchar
列中,因此 SQL Server CE 抛出错误。
我知道ntext
可以存储超过4000个字符,但将来几乎支持。
如何将超过 4000 个字符的字符串插入到 nvarchar
列中,以便 SQL Server CE ?
最佳答案
不幸的是data type options are limited in SQL CE 。您需要使用 ntext
来支持超过 4000 个字符。
note: ntext is no longer supported in string functions.
除非使用 is null
或 like
,否则您将无法对 ntext
进行比较或排序。
只要您不尝试比较 ntext
的值,您就可以使用 ntext
进行选择、更新、删除、插入
code> 列,但 is null
或 like
除外。
所以你不能:
update t
set ntxt = 'I miss nvarchar(max)'
where ntxt = 'I am using sql ce'
但是你可以
update t
set ntxt = 'I miss nvarchar(max)'
where ntxt like '%sql ce'
关于sql - 如何在SQL Server CE中插入超过4000个字符的nvarchar数据类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42874614/