当前位置:网站首页>Data types ntext and varchar are incompatible in the not equal to operator - 95 small pang
Data types ntext and varchar are incompatible in the not equal to operator - 95 small pang
2022-07-05 10:50:00 【Ninth Five Year Plan small pang】
SQL sentence :select * from A where test=’xxx’
After execution, there will be :
data type ntext and varchar stay equal to Incompatible error messages in operator .
Is it worth ntext Just type ?
That handle SQL Statement should become :select * from A where test=convert(ntext,’xxx’)
Results appear : data type ntext and ntext stay equal to Incompatible error messages in operator .
There are many ways to solve this problem 2 Kind of way :
1. Directly change the database field type ....( No cure )
2. hold SQL Statement modified to :
select * from A where convert(nvarchar(255),test)=’xxx’
Because it doesn't matter text still nvarchar, All mappings in entity classes should be string, because C# only one string Is used to represent strings , However, these two data types are completely different in the database , Therefore, it is impossible to compare them , Especially that one ntext, Many operations cannot be done , Even if it's two ntext type , There is no way to compare . It's fine too select * from A where test like’xxx’
边栏推荐
猜你喜欢
微信核酸检测预约小程序系统毕业设计毕设(6)开题答辩PPT
第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!
SAP ui5 objectpagelayout control usage sharing
Review the whole process of the 5th Polkadot Hackathon entrepreneurship competition, and uncover the secrets of the winning projects!
Talk about the understanding of fault tolerance mechanism and state consistency in Flink framework
Broyage · fusion | savoir que le site officiel de chuangyu mobile end est en ligne et commencer le voyage de sécurité numérique!
32: Chapter 3: development of pass service: 15: Browser storage media, introduction; (cookie,Session Storage,Local Storage)
[vite] 1371 - develop vite plug-ins by hand
In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
Comparative learning in the period of "arms race"
随机推荐
Ad20 make logo
跨页面通讯
沟通的艺术III:看人之间 之倾听
NAS and San
数据库中的范式:第一范式,第二范式,第三范式
括号匹配问题(STL)
使用bat命令一键启动常用浏览器
变量///
函数///
磨砺·聚变|知道创宇移动端官网焕新上线,开启数字安全之旅!
csdn软件测试入门的测试基本流程
重磅:国产IDE发布,由阿里研发,完全开源!
Go-3-the first go program
DOM//
C语言活期储蓄账户管理系统
Array
beego跨域问题解决方案-亲试成功
A usage example that can be compatible with various database transactions
Node の MongoDB Driver
Go language learning notes - first acquaintance with go language