2017-03-18 55 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操作數據庫 –

相關問題