2,596
社区成员
发帖
与我相关
我的任务
分享
ALTER PROCEDURE [dbo].[InsertOrders]
@userNameCO varchar(50),
@coLocId int,
@receiveName varchar(50),
@phone varchar(50),
@address varchar(250),
@totalPrice decimal(12,2),
@orderId int output
AS
BEGIN
INSERT INTO Orders (UserNameCo, CoLocId, ReceiveName, Phone, Address, TotalPrice)
VALUES (@userNameCO,@coLocId,@receiveName,@phone,@Address,@totalPrice)
select @orderId=@@identity
END
ALTER PROCEDURE [dbo].[InsertOrderDetails]
@orderId int,
@itemId int,
@uniCost decimal(12,2),
@quantity int
AS
BEGIN
INSERT INTO OrderDetails (OrderId, ItemId, UniCost, Quantity)
VALUES (@orderId,@itemId,@uniCost,@quantity)
END