我想在三个表的一页中从用户那里获取记录,即Sender
Receiver
我Parcel
为它编写存储过程,但是当我保存它时。它给出了以下ERROR
我无法理解的ieERROR
不正确syntax
@P_ID
Store Procedure code
就像_
ALTER PROCEDURE dbo.ExSenderReceiveParcel
@S_Name varchar(Max),
@S_Country varchar(Max),
@S_City varchar(Max),
@S_StreetNo varchar(Max),
@S_HouseNo varchar(Max),
@S_Phone varchar(Max),
@S_Mobile varchar(Max),
@S_Email varchar(Max),
@S_CreditCardNo varchar(Max),
@S_PinCode varchar(Max),
@R_Name varchar(Max),
@R_Country varchar(Max),
@R_City varchar(Max),
@R_StreetNo varchar(Max),
@R_HouseNo varchar(Max),
@R_Phone varchar(Max),
@R_Mobile varchar(Max),
@R_Email varchar(Max),
@P_Weight varchar(MAX),
@P_Status varchar(MAX),
@P_Location varchar(MAX),
@P_Id numeric(18, 0) out
作为开始
DECLARE @S_Id numeric(18, 0),
@R_Id numeric(18, 0)
INSERT INTO Sender
(Name, S_Country, S_City, StreetNo, HouseNo, Phone, Mobile, Email, CreditCardNo, PinCode)
VALUES (
@S_Name,
@S_Country,
@S_City,
@S_StreetNo,
@S_HouseNo,
@S_Phone,
@S_Mobile,
@S_Email,
@S_CreditCardNo,
@S_PinCode);
SET @S_Id = SCOPE_IDENTITY();
INSERT INTO Receiver
(Name, R_Country, R_City, StreetNo, HouseNo, Phone, Mobile, Email)
VALUES
(
@R_Name,
@R_Country,
@R_City,
@R_StreetNo,
@R_HouseNo,
@R_Phone,
@R_Mobile,
@R_Email
);
SET @R_Id = SCOPE_IDENTITY();
INSERT INTO Parcel
(Weight, Status, Location, Sender_Id, Receiver_Id)
VALUES
(
@P_Weight,
@P_Status,
@P_Location,
@S_Id,
@R_Id
);
SET @P_Id = SCOPE_IDENTITY();
Select @P_Id