SQL Server 2000:数据类型的运算符无效。运算符等于 add,类型等于 ntext
我有一些代码在 SQL Server 2008 上运行得很好,但是我被迫在 SQL Server 2000 服务器上尝试它,但它失败了。
基本上我想要合并两列,中间用逗号。
SELECT COALESCE(cardesc1, '') + ', ' + COALESCE(cardesc2, '') AS "Car Summary" FROM macros;
I've got some code that runs all lovely on SQL Server 2008, however I'm forced to try it on SQL Server 2000 server, where it falls down.
Basically I'm looking to combine two columns, with a comma in-between.
SELECT COALESCE(cardesc1, '') + ', ' + COALESCE(cardesc2, '') AS "Car Summary" FROM macros;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了!
SELECT COALESCE(cardesc1, '') + ', ' + COALESCE(convert(varchar(100),cardesc2), '') AS “汽车摘要” FROM 宏;
Solved it!
SELECT COALESCE(cardesc1, '') + ', ' + COALESCE(convert(varchar(100),cardesc2), '') AS "Car Summary" FROM macros;