我正在尝试执行mySql语句
"DECLARE DONE INT(1) default 0;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE = 1;"
在SQL Server 2005中
" DECLARE @DONE INT,
DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE = 1"
它给出了错误,如
"Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'CONTINUE'.
Msg 136, Level 15, State 1, Line 1
Cannot use a CONTINUE statement outside the scope of a WHILE statement."
答案 0 :(得分:1)
SQL Server没有与上面链接的documentation中描述的处理程序机制直接等效。最明显的替代方案是:
TRY...CATCH...