CREATE PROCEDURE Test12
@varwi_name nvarchar(50)
AS
BEGIN
DECLARE @newbalance nvarchar(400)
BEGIN
SELECT
@newbalance = (SELECT
(CAST(a.currentBal as INT) * CAST( b.monthlyInterestRate AS INT)) / 100
FROM
USR_0_CLOS_TransDet_TXN a, USR_0_CLOS_LoanReg_TXN b ON a.wi_name = b.wi_name)
WHERE
wi_name = @varwi_name
END
GO
我收到错误
关键字' ON'附近的语法不正确。严重性15测试12
答案 0 :(得分:1)
应该看起来:
CREATE PROCEDURE Test12
@varwi_name nvarchar(50)
AS
BEGIN
DECLARE @newbalance nvarchar(400);
SELECT
@newbalance = (
SELECT
(CAST(a.currentBal AS int) * CAST(b.monthlyInterestRate AS int)) / 100
FROM
USR_0_CLOS_TransDet_TXN a
JOIN USR_0_CLOS_LoanReg_TXN b ON a.wi_name = b.wi_name
WHERE
wi_name = @varwi_name
);
END;
GO