当前位置:网站首页>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’
边栏推荐
猜你喜欢
LSTM应用于MNIST数据集分类(与CNN做对比)
Go language-1-development environment configuration
Web3 Foundation grant program empowers developers to review four successful projects
go语言学习笔记-初识Go语言
The first product of Sepp power battery was officially launched
Go-3-the first go program
爬虫(9) - Scrapy框架(1) | Scrapy 异步网络爬虫框架
"Everyday Mathematics" serial 58: February 27
Learning note 4 -- Key Technologies of high-precision map (Part 2)
Ad20 make logo
随机推荐
GBase 8c数据库如何查看登录用户的登录信息,如上一次登录认证通过的日期、时间和IP等信息?
Go语言-1-开发环境配置
基于昇腾AI丨爱笔智能推出银行网点数字化解决方案,实现从总部到网点的信息数字化全覆盖
Go language learning notes - first acquaintance with go language
运算符、、
Web Components
Node の MongoDB Driver
关于vray 5.2的使用(自研笔记)
Share Net lightweight ORM
【JS】提取字符串中的分数,汇总后算出平均分,并与每个分数比较,输出
九度 1480:最大上升子序列和(动态规划思想求最值)
脚手架开发基础
dsPIC33EP 时钟初始化程序
Nine degrees 1480: maximum ascending subsequence sum (dynamic programming idea for the maximum value)
iframe
Array
变量///
PWA (Progressive Web App)
Process control
websocket