Sql Compact:查询 Ntext 列
我最近将一列从 nvarchar(4000) 更改为 ntext。之后我收到“ntext 和 image 数据类型不能在 WHERE、HAVING、GROUP BY、ON 或 IN 子句中使用,除非这些数据类型与 LIKE 或 IS NULL 谓词一起使用。”像这样的基本查询的例外:
select BLAH FROM Table WHERE Text = @Text
这是 Sql Compact 3.5 的问题吗?我已经更新到 3.5 SP2,因为我发现这是 LINQ 查询的问题,但我不知道这是正常查询的问题。
I recently changed a column from nvarchar(4000) to ntext. Afterwards I'm getting an '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.' exception off a basic query like this:
select BLAH FROM Table WHERE Text = @Text
Is this an issue with Sql Compact 3.5? I have updated to 3.5 SP2 because I saw that this was an issue with LINQ queryies, but I didn't know it was an issue with normal queries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 SQL CE 3.5 中处理此问题的一种方法是除了 NText 之外还使用 nvarchar(4000)。您可以对字符串的前 4000 个字符进行搜索、排序、预览等操作 - 但您不能同时尝试存储任意长度的数据 (ntext) 是一个有限的设备,但又期望它对 varchar 也有良好的支持 -支持对同一列进行操作。至少在 SQL CE 的更高版本之前,设备功能更加强大。
One way to handle this in SQL CE 3.5 is to have a nvarchar(4000) in addition to an NText. You can work on the first 4000 characters of the string for searching, sorting, preview etc - but you cannot both try to store an arbitrary length of data (ntext) is a limited device, yet expect it to also have good support for varchar-supported operations on the same column. At least not until later version of SQL CE when devices are more powerful.
这不仅仅是SQLCE,普通的SQL Server 也是如此。
This is not just SQLCE, the same goes for normal SQL server too.