我创建这样的存储过程,但越来越近@计数和@ count == 0的错误。任何人都可以figuer问题
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AddToCart]
@CustomerID varchar(50),
@ProductID int,
@Quantity int,
@Count int
@Count=select count (*) from table where ProductID=@ProductID;
If(@Count==0)
AS
BEGIN
INSERT INTO ShoppingCart
(CustomerID,Quantity,ProductID)
VALUES(@CustomerID,@Quantity,@ProductID)
END