当前位置:网站首页>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’
边栏推荐
猜你喜欢

AD20 制作 Logo

The first product of Sepp power battery was officially launched

"Everyday Mathematics" serial 58: February 27

磨礪·聚變|知道創宇移動端官網煥新上線,開啟數字安全之旅!

第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!

微信核酸检测预约小程序系统毕业设计毕设(8)毕业设计论文模板

2022年流动式起重机司机考试题库及模拟考试

csdn软件测试入门的测试基本流程
![[dark horse morning post] Luo Yonghao responded to ridicule Oriental selection; Dong Qing's husband Mi Chunlei was executed for more than 700million; Geely officially acquired Meizu; Huawei releases M](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[dark horse morning post] Luo Yonghao responded to ridicule Oriental selection; Dong Qing's husband Mi Chunlei was executed for more than 700million; Geely officially acquired Meizu; Huawei releases M

32:第三章:开发通行证服务:15:浏览器存储介质,简介;(cookie,Session Storage,Local Storage)
随机推荐
九度 1480:最大上升子序列和(动态规划思想求最值)
Taro advanced
运算符、、
PWA (Progressive Web App)
Explanation of full vulnerability script of network security C module of secondary vocational group script containing 4 vulnerabilities
Nuxt//
Review the whole process of the 5th Polkadot Hackathon entrepreneurship competition, and uncover the secrets of the winning projects!
SAP ui5 objectpagelayout control usage sharing
【JS】提取字符串中的分数,汇总后算出平均分,并与每个分数比较,输出
How can gbase 8C database view the login information of the login user, such as the date, time and IP of the last login authentication?
[dark horse morning post] Luo Yonghao responded to ridicule Oriental selection; Dong Qing's husband Mi Chunlei was executed for more than 700million; Geely officially acquired Meizu; Huawei releases M
Web3 Foundation grant program empowers developers to review four successful projects
Customize the left sliding button in the line in the applet, which is similar to the QQ and Wx message interface
The first product of Sepp power battery was officially launched
SQL Server 监控统计阻塞脚本信息
Go project practice - Gorm format time field
ModuleNotFoundError: No module named ‘scrapy‘ 终极解决方式
Lazy loading scheme of pictures
Web Components
Go语言-1-开发环境配置