I am trying to set variables in my stored procedure when the passed parameter is a certain value like this:
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
I keep getting an error when I try to parse it. Does anyone know why?
1 Answer