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

Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework

csdn软件测试入门的测试基本流程

LSTM应用于MNIST数据集分类(与CNN做对比)

Review the whole process of the 5th Polkadot Hackathon entrepreneurship competition, and uncover the secrets of the winning projects!

The first product of Sepp power battery was officially launched

Learning Note 6 - satellite positioning technology (Part 1)

非技術部門,如何參與 DevOps?
![[paper reading] kgat: knowledge graph attention network for recommendation](/img/fa/d2061bc7bd437f062d46a009cf32cf.png)
[paper reading] kgat: knowledge graph attention network for recommendation

DGL中的消息传递相关内容的讲解

SAP ui5 objectpagelayout control usage sharing
随机推荐
Go language learning notes - first acquaintance with go language
When using gbase 8C database, an error is reported: 80000502, cluster:%s is busy. What's going on?
分享.NET 轻量级的ORM
GBase 8c数据库如何查看登录用户的登录信息,如上一次登录认证通过的日期、时间和IP等信息?
In wechat applet, after jumping from one page to another, I found that the page scrolled synchronously after returning
A usage example that can be compatible with various database transactions
DGL中的消息传递相关内容的讲解
Taro advanced
[paper reading] ckan: collaborative knowledge aware autonomous network for adviser systems
Share Net lightweight ORM
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
第五届 Polkadot Hackathon 创业大赛全程回顾,获胜项目揭秘!
Array
String
C language QQ chat room small project [complete source code]
LDAP概述
小程序框架Taro
【Vite】1371- 手把手开发 Vite 插件
微信核酸检测预约小程序系统毕业设计毕设(8)毕业设计论文模板
In the year of "mutual entanglement" of mobile phone manufacturers, the "machine sea tactics" failed, and the "slow pace" playing method rose