考虑:
CREATE PROCEDURE LowerCityDiscounts @city VARCHAR(45),@decrease DECIMAL(10,2) AS BEGIN BEGIN TRANSACTION; UPDATE Customers SET discnt = discnt - @decrease WHERE Customers.city = @city; UPDATE Customers SET discnt = 0 WHERE Customers.city = @city AND discnt < 0 COMMIT; END;
我试图用这个程序来调用:
CALL LowerCityDiscounts 'Cleveland',5;
但这只会产生
Msg 102,Level 15,State 1,Line 1 Incorrect Syntax near 'Cleveland'.
然而,如果我改变事情
EXEC LowerCityDiscounts 'Cleveland',5;
一切正常尽管the documentation表示该调用是正确的语法.
为什么执行委员会在CALL没有工作?