一個簡單的例子:無法將NULL插入到SQL CE的NTEXT字段中?
CREATE TABLE People (
personID int not null
, name nvarchar(50) not null
, addrLine1 nvarchar(50) null
, addrLine2 nvarchar(50) null
, suburb nvarchar(30) not null
, xmlRawInput ntext not null
, xmlRawOutput ntext null
)
GO
INSERT People (
personID
, name
, addrLine1
, addrLine2
, suburb
, xmlRawInput
, xmlRawOutput
)
SELECT
101 AS personID
, 'george benson' AS name
, '123 help st' AS addrLine1
, NULL AS addrLine2
, 'los angeles' AS suburb
, '<example>record<example>' AS xmlRawInput
, 'I LOVE MICROSOFT' AS xmlRawOutput
GO
這工作正常;注意Null可以很容易地插入到addrLine2列中;但如果我在ntext列更改 '我愛微軟'爲NULL,我收到以下錯誤: 轉換不受支持。 [類型轉換爲(如果知道)= int,類型轉換爲(如果已知)= ntext]
插入失敗,有任何想法嗎?我正在使用CE版本3.5.8080.0。
INSERT People (
personID
, name
, addrLine1
, addrLine2
, suburb
, xmlRawInput
, xmlRawOutput
)
SELECT
101 AS personID
, 'george benson' AS name
, '123 help st' AS addrLine1
, NULL AS addrLine2
, 'los angeles' AS suburb
, '<example>record<example>' AS xmlRawInput
, NULL AS xmlRawOutput
GO
看起來像一個錯誤 - 你可以嘗試以前的版本,看看它是否顯示在那裏? – 2010-12-01 04:43:44