How can I alter Update Stored Procedure so if developer want to set only Size
then he/she does not requireed to pass TimeStamp
. Moreover, then what will be execute code for this procedure?
Scenario:
Update TimeStamp = getdate()
field whose SizeID = 1
AND Size =Large
Note: This field Parameters and condition parameters must be dynamic and optionals like in where TimeStamp
can also be supplied.
Update Stored Procedure:
ALTER PROCEDURE [dbo].[SP_Sizes_Update]
@SizeID int,
@Size varchar(50),
@TimeStamp datetime
AS
Update Sizes
Set
Size = @Size,
TimeStamp = @TimeStamp
Where
SizeID = @SizeID