当前位置:网站首页>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,%'
边栏推荐
- Day9 of Hegong Daqiong team vision team training - camera calibration
- 691. 立方体IV
- 女生做软件测试会不会成为一个趋势?
- LabVIEW中如何实现任意形状的不规则按键
- (4) Rotating object detection data roLabelImg to DOTA format
- UDP广播
- protobuf is compiled against the associated .proto file
- 对数据类型而言运算符无效。运算符为 add,类型为 text。
- Nacos cluster construction
- 1、Citrix XenDesktop 2203之AD域系统安装(一)
猜你喜欢

FPGA parsing B code----serial 4

AI + video technology helps to ensure campus security, how to build a campus intelligent security platform?

MySQL: basic part

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

typescript64-映射类型

2022 crane driver (limited bridge crane) exam question bank and simulation test

typescript68-索引查询类型(查询多个)

算法拾遗十五补链表相关面试题

二叉搜索树问题

(JLK105D)中山爆款LED恒流电源芯片方案
随机推荐
不太会讲爱,其实已经偷偷幸福很久啦----我们的故事
MySQL:JDBC编程
日本卫生设备行业协会:日本温水喷淋马桶座出货量达1亿套
AI + video technology helps to ensure campus security, how to build a campus intelligent security platform?
TCP sticky packet unpacking problem + solution
HR:这样的简历我只看了5秒就扔了,软件测试简历模板想要的进。
AH8669-AC380/VAC220V转降5V12V24V500MA内电源芯片IC方案
typescript60-泛型工具类型(readonly)
binary search tree problem
今天虚竹哥又发现了一款好用的国产化API工具
不能比较或排序 text、ntext 和 image 数据类型
protobuf根据有关联的.proto文件进行编译
数据库多表关联插入数据
MySQL: JDBC programming
2022 Fusion Welding and Thermal Cutting Operation Certificate Exam Questions and Mock Exams
360度反馈调查表中的问题示范
1、Citrix XenDesktop 2203之AD域系统安装(一)
Modeling of the MAYA ship
2022熔化焊接与热切割操作证考试题及模拟考试
LaTeX Notes