当前位置:网站首页>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,%'
边栏推荐
- 2022熔化焊接与热切割操作证考试题及模拟考试
- GAN生成动漫头像Pytorch
- Tencent Internship Summary
- (2022杭电多校六)1010-Planar graph(最小生成树)
- Summary of Text Characterization Methods
- Tencent Business Security Post IDP Talk Summary
- Advanced Redis
- Shiny02---Shiny exception solution
- Put Cloudflare on the website (take Tencent Cloud as an example)
- 香港国际珠宝展及香港国际钻石、宝石及珍珠展揭幕
猜你喜欢

HR:这样的简历我只看了5秒就扔了,软件测试简历模板想要的进。

RNote108---显示R程序的运行进度

女生做软件测试会不会成为一个趋势?

Source code analysis of Nacos configuration service (full)

UDP广播

Redis进阶

typescript67-索引查询类型

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

Task flow scheduling tool AirFlow,, 220804,,

TCP的粘包拆包问题+解决方案
随机推荐
RNote108---显示R程序的运行进度
(四)旋转物体检测数据roLabelImg转DOTA格式
re正则表达式
怎么样避免线上内存泄漏
Shared memory + inotify mechanism to achieve multi-process low-latency data sharing
Takeda Fiscal 2022 First Quarter Results Strong; On Track to Achieve Full-Year Management Guidance
Mysql master-slave delay reasons and solutions
MySQL:order by排序查询,group by分组查询
Task flow scheduling tool AirFlow,, 220804,,
360度反馈调查表中的问题示范
今天虚竹哥又发现了一款好用的国产化API工具
在anaconda Promat界面import torch通过,在jupyter notebook中报错的问题(仅提供思路理解!)
2022熔化焊接与热切割操作证考试题及模拟考试
腾讯实习总结
TCP sticky packet unpacking problem + solution
铠侠携手Aerospike提升数据库应用性能
GAN generates anime avatar Pytorch
开启防火墙iptable规则后,系统网络变慢
Rapid Medical超小体积且唯一可调的取栓器获得FDA核准
2022 crane driver (limited bridge crane) exam question bank and simulation test