当前位置:网站首页>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’
边栏推荐
- 2021年山东省赛题库题目抓包
- Network security of secondary vocational group 2021 Jiangsu provincial competition 5 sets of topics environment + analysis of all necessary private messages I
- Learning notes 5 - high precision map solution
- 正则表达式
- [paper reading] ckan: collaborative knowledge aware autonomous network for adviser systems
- PWA (Progressive Web App)
- 图片懒加载的方案
- 中职组网络安全C模块全漏洞脚本讲解包含4个漏洞的脚本
- Blockbuster: the domestic IDE is released, developed by Alibaba, and is completely open source!
- Do you really understand the things about "prototype"? [part I]
猜你喜欢
Ad20 make logo
Go-3-第一个Go程序
Honing · fusion | know that the official website of Chuangyu mobile terminal is newly launched, and start the journey of digital security!
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
关于vray 5.2的使用(自研笔记)(二)
Pseudo class elements -- before and after
九、磁盘管理
go语言学习笔记-初识Go语言
Learning note 4 -- Key Technologies of high-precision map (Part 2)
关于vray 5.2的使用(自研笔记)
随机推荐
BOM//
Data type
LDAP概述
Process control
微信核酸检测预约小程序系统毕业设计毕设(7)中期检查报告
In wechat applet, after jumping from one page to another, I found that the page scrolled synchronously after returning
Go project practice - parameter binding, type conversion
【Vite】1371- 手把手开发 Vite 插件
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
非技術部門,如何參與 DevOps?
web安全
微信核酸检测预约小程序系统毕业设计毕设(6)开题答辩PPT
Web3基金会「Grant计划」赋能开发者,盘点四大成功项目
Advanced scaffold development
Web Components
Broyage · fusion | savoir que le site officiel de chuangyu mobile end est en ligne et commencer le voyage de sécurité numérique!
Nuxt//