当前位置:网站首页>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’
边栏推荐
猜你喜欢
Comparative learning in the period of "arms race"
关于vray 5.2的使用(自研笔记)(二)
Implement the rising edge in C #, and simulate the PLC environment to verify the difference between if statement using the rising edge and not using the rising edge
LSTM应用于MNIST数据集分类(与CNN做对比)
微信核酸检测预约小程序系统毕业设计毕设(7)中期检查报告
In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose
The first product of Sepp power battery was officially launched
32: Chapter 3: development of pass service: 15: Browser storage media, introduction; (cookie,Session Storage,Local Storage)
第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!
赛克瑞浦动力电池首台产品正式下线
随机推荐
DOM//
关于vray 5.2的使用(自研笔记)(二)
C#实现获取DevExpress中GridView表格进行过滤或排序后的数据
Buried point 111
分享.NET 轻量级的ORM
使用bat命令一键启动常用浏览器
Nine degrees 1480: maximum ascending subsequence sum (dynamic programming idea for the maximum value)
Solution to the length of flex4 and Flex3 combox drop-down box
正则表达式
微信核酸检测预约小程序系统毕业设计毕设(6)开题答辩PPT
vite//
Node の MongoDB Driver
flex4 和 flex3 combox 下拉框长度的解决办法
Ad20 make logo
How can non-technical departments participate in Devops?
Data type
使用GBase 8c数据库过程中报错:80000502,Cluster:%s is busy,是怎么回事?
2022年流动式起重机司机考试题库及模拟考试
基于昇腾AI丨爱笔智能推出银行网点数字化解决方案,实现从总部到网点的信息数字化全覆盖
Share Net lightweight ORM