27 lines
1.0 KiB
Plaintext
27 lines
1.0 KiB
Plaintext
CREATE PROCEDURE [dbo].[sp_SensorCalibrationsSensitivityInspectionSet]
|
|
@SensorId INT,
|
|
@SensorCalibrationId INT,
|
|
@SensitivityInspection INT,
|
|
@CalibrationNote NVARCHAR(2048),
|
|
@errorNumber INT OUTPUT,
|
|
@errorMessage NVARCHAR (255) OUTPUT
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
SET @errorNumber = 0
|
|
SET @errorMessage = ''
|
|
|
|
IF (@CalibrationNote IS NULL or @CalibrationNote = '')
|
|
BEGIN
|
|
UPDATE [dbo].[SensorCalibrations] SET [SensitivityInspection] = @SensitivityInspection WHERE [SensorId]= @SensorId AND [SensorCalibrationId]=@SensorCalibrationId ;
|
|
END
|
|
ELSE
|
|
BEGIN
|
|
UPDATE [dbo].[SensorCalibrations] SET [SensitivityInspection] = @SensitivityInspection, [CalibrationNote] = @CalibrationNote WHERE [SensorId]= @SensorId AND [SensorCalibrationId]=@SensorCalibrationId ;
|
|
END
|
|
IF(@@error != 0)
|
|
BEGIN
|
|
SET @errorNumber = error_number()
|
|
SET @errorMessage = error_message()
|
|
END
|
|
END |