SQL The data types ntext and varchar are incompatible in the not equal to operator 错误
2012-01-05 21:33
609 查看
在SQL中,需要判断标题和文本内容为空(不是null ''与null是有区别的).
如果直接 通过 字段<>'' 会报上面的错误提示,
正确的判断方法为 CONVERT(NVARCHAR(4000),[名称])<>''
因为 NTEXT不能直接和VARCHAR比较. 实际情况是你把ntext数据转换nvarchar(max)
这个错误翻译过来的意思是:
对数据类型而言运算符无效。
所以需要去转换下数据来进行比较
如果直接 通过 字段<>'' 会报上面的错误提示,
正确的判断方法为 CONVERT(NVARCHAR(4000),[名称])<>''
因为 NTEXT不能直接和VARCHAR比较. 实际情况是你把ntext数据转换nvarchar(max)
这个错误翻译过来的意思是:
对数据类型而言运算符无效。
所以需要去转换下数据来进行比较
相关文章推荐
- Could not store transport type data for Receive Location 'Recv.Loc' to config store. Primary SSO Server 'Sql-server' failed. The external credentials in the SSO database are more recent.
- MySQL错误:Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL easonjim
- Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_100_CI_AS" in the equal to operation.
- This function has none of Deterministic,no sql,or reads sql data in its declaration and binary logging is enabled(you *might* want to use the less safe log_bin_trust_function_creators variable
- The text, ntext, and image data types are invalid in this subquery or aggregate expression.
- Here are a few guidelines to keep in mind regarding C data types on the C6000?
- sql左连接时发生字符集错误Cannot resolve the collation conflict between in the equal to operation.
- Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AS" in the equal to operation.
- How to select the data type in SQLserver database such as varchar, nvarchar
- 解决配置SQL MDS服务时遇到“The required .svc handler mappings are not installed in IIS”错误
- 海洋工作室——网站建设专家:The version of SQL Server in use does not support datatype datetime2 and the Entity Framework.
- LINQ to SQL 异常:SQL Server does not handle comparison of NText, Text, Xml, or Image data types
- 解决配置SQL MDS服务时遇到“The required .svc handler mappings are not installed in IIS”错误
- sql常犯错误之不正确的谓词运算顺序Conversion failed when converting the varchar value 'abc' to data type int
- 【MySQL笔记】解除输入的安全模式,Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect.
- Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to
- How to fix the issue that GEM_HOME and/or GEM_PATH not set issue for rvm in mac version 10.12
- CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
- [Nuxt] Add Arrays of Data to the Vuex Store and Display Them in Vue.js Templates
- tomcat报"The servlets named [x] and [y] are both mapped to the url-pattern[z] which is not permitted"