Consider:
CREATE PROCEDURE LowerCityDiscounts @city VARCHAR(45), @decrease DECIMAL(10,2) AS
BEGIN
BEGIN TRANSACTION;
UPDATE Customers SET discnt = discnt
The T-SQL language does not recognise ODBC escape sequences; EXEC
is the only command available for calling a stored procedure. ODBC escape sequences are interpreted by client-side libraries (e.g. ODBC, OLE DB, ADO, ADO.NET) and translated to real T-SQL syntax on the fly before execution.
The end result is, you can call your top-level stored procedure from the client using CALL
if you want to, but if that procedure calls others, it must use EXEC
.
The same principle applies for the date/time literal escape sequences.