当传递的参数是这样的某个值时,我试图在我的存储过程中设置变量:
ALTER PROCEDURE [dbo].[Procedure1]
(
@ID int,
@WatchType varchar(100)
)
AS
SET NOCOUNT ON
DECLARE @stock int
DECLARE @price float
DECLARE @details varchar(max)
CASE @WatchType
WHEN 'TIMEX' THEN
(SELECT @stock= Stock,
@price= Price,
@details= Details,
FROM tblWatches WHERE Uid= @ID)
ELSE
END
当我尝试解析它时,我不断收到错误。有谁知道为什么?