2017-03-18 54 views
1

我插入字符串超过4000个字符为nvarchar列,因此的SQL Server CE是抛出一个错误。如何在SQL Server CE中插入数据类型为nvarchar超过4000个字符?

我知道ntext可以存储超过4000个字符,但它在未来几乎支持。

如何这样我可以插入串超过4000个字符列nvarchar这样的SQL Server CE?

+0

你***不能***店超过4000个字符到在SQL Server CE一个'nvarchar' - 那里只是没有办法做到这一点。如果您需要超过4000个字符,请使用'ntext' - 这就是它的用处。 –

+0

@marc_s:ntext用于选择子句where..where..order by? –

回答

1

不幸的是,data type options are limited in SQL CE。您将需要使用ntext来支持超过4000个字符。

注:NTEXT不再字符串函数的支持。

您将无法进行比较或排序ntext使用is nulllike时除外。

The ntext and image data types cannot be used in WHERE, HAVING, GROUP BY, ON, or IN clauses, except when these data types are used with the LIKE or IS NULL predicates

您将能够select, update, delete, insertntext,只要你是不是想在ntext列的值与is nulllike例外比较。

,所以你不能:

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' 
+0

ntext在条款select .. where..order by中使用得很好? –

+0

我很困惑语句选择,更新,删除,插入,他们可以很好地工作???????因为我使用winform操作数据库 –

相关问题