当前位置:网站首页>Invalid operator for data type.The operator is add and the type is text.
Invalid operator for data type.The operator is add and the type is text.
2022-08-05 07:11:00 【51CTO】
Recently, when developing a file management system, I encountered another problem: the original local database was SQL2008, and there was a field SharedUserId of nvarchar(max) type.The query SQL statement uses...WHERE SharedUserId + ',' LIKE '%2,%', which can be executed normally.Later, I released the program to the space server I bought. The server is the database of SQL2000. Because SQL2000 does not have the nvarchar(max) type, I even changed it to the text type. As a result, the program reported an error when executing the same SQL statement:
So, I even changed the local database field type to text, and then tested it, and a similar error was reported (even the SQL2008 is in English):
After searching on the Internet, the original query statement was slightly modified (convert text to nvarchar and then perform + operation), and it worked:...WHERE SharedUserId + ',' LIKE '%2,%' is replaced by...WHERE CAST(SharedUserId AS NVARCHAR) + ',' LIKE '%2,%' or WHERE CONVERT(NVARCHAR, SharedUserId) + ',' LIKE '%2,%'
边栏推荐
- 不太会讲爱,其实已经偷偷幸福很久啦----我们的故事
- typescript66-分析partial的实现
- Day9 of Hegong Daqiong team vision team training - camera calibration
- 1, Citrix XenDesktop 2203 AD domain system installation (1)
- 给网站套上Cloudflare(以腾讯云为例)
- Put Cloudflare on the website (take Tencent Cloud as an example)
- 不能比较或排序 text、ntext 和 image 数据类型
- 今天虚竹哥又发现了一款好用的国产化API工具
- UDP组(多)播
- 【Go】IM系统Centrifugo
猜你喜欢

Flink学习11:flink程序并行度

(2022杭电多校六)1010-Planar graph(最小生成树)

3555. 二叉树

软件测试必问面试题(附答案和解析)

字节面试流程及面试题无私奉献,吐血整理

After working for 3 years, I recalled the comparison between the past and the present when I first started, and joked about my testing career

开源中国活动合作说明书

Flink学习12:DataStreaming API

真实字节跳动测试开发面试题,拿下年薪50万offer。

Week 8 Document Clustering(文本聚类)
随机推荐
【网友真实投稿】为女友放弃国企舒适圈,转行软件测试12k*13薪
Shared memory + inotify mechanism to achieve multi-process low-latency data sharing
MySQL:order by排序查询,group by分组查询
技术分析模式(九)三重顶部和底部
Libpq 是否支持读写分离配置
LaTeX Notes
开启防火墙iptable规则后,系统网络变慢
铠侠携手Aerospike提升数据库应用性能
原来使Maya Arnold也能渲染出高质量作品!超赞小技巧
专用机终端安装软件后报IP冲突
typescript65-映射类型(keyof)
After working for 3 years, I recalled the comparison between the past and the present when I first started, and joked about my testing career
Bluetooth gap protocol
typescript61-泛型工具类型(pick)
typescript67-索引查询类型
MySQL:JDBC编程
【LeetCode】235.二叉搜索树的最近公共祖先
工作3年,回想刚入门和现在的今昔对比,笑谈一下自己的测试生涯
Flink学习10:使用idea编写WordCount,并打包运行
MySQL:连接查询 | 内连接,外连接