CREATE PROCEDURE [dbo].[pos_InvoiceDetailAdd150907]
@billId VARCHAR(10),
@itemNum INT,
@item VARCHAR(50),
@unitPrice DECIMAL(10,3),
@amount DECIMAL(10,3)
AS
DECLARE @MAXID INT
SELECT @MAXID=MAX(ID)+1 FROM XY_INVOICEDETAIL WHERE BILLID=@billId
INSERT INTO XY_INVOICEDETAIL(ID,BILLID,ITEMNUM,ITEM,FCUP,FCAMOUNT) VALUES(@MAXID,@billId,@itemNum,@item,@unitPrice,@amount)
GO
SQL中把查询到值赋值给变量
最新推荐文章于 2022-11-08 15:35:49 发布