SQL 2000数据库中的SQL Server 2012语法错误 [英] sql server 2012 syntax error in SQL 2000 database

查看:193
本文介绍了SQL 2000数据库中的SQL Server 2012语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚升级到SQL Server 2012并运行一个从2000年开始的数据库,然后转移到2005年。



执行包含动态sql的存储过程时,收到错误不正确语法附近'''''



这是sql的一小部分(我相信它是Else:导致错误的部分)。



Just upgraded to SQL Server 2012 and running a database that started in 2000 then moved to 2005.

When executing a stored procedure containing dynamic sql, getting error Incorrect syntax near '':''

This is a small part of the sql (I believe it is the Else: parts causing the error).

SELECT @sortorder='CASE Invoiced WHEN 1 THEN CASE InvoicePaid WHEN 1 THEN 7 ELSE 5 END ELSE:  CASE Delivered WHEN 1 THEN 4 ELSE: CASE WHEN Date_Needed <= getdate() THEN 1 ELSE: CASE Assembly_Completed WHEN 0 THEN 3 ELSE 2 END END END END'







我没有'写这个,所以不确定'':''在这种情况下意味着什么。



感谢我能得到的任何帮助。



谢谢 - Colin Mac




I didn''t write this so not sure what the '':'' means in this context.

Appreciate any help I can get on this.

Thanks - Colin Mac

推荐答案

只需在 ELSE 之后删除



据我所知,else语句的语法不接受(你可以看一下这里)。



希望这有帮助。
Just remove the : after ELSE.

As far as I know, syntax for else statement does not accept : (you can watch it here).

Hope this helps.


这篇关于SQL 2000数据库中的SQL Server 2012语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆