init
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,62 @@
|
||||
CREATE PROCEDURE [dbo].[sp_SensorCalibrationsUpdate_98]
|
||||
@SensorSerialNumber nvarchar(50) = null
|
||||
,@CalibrationDate datetime
|
||||
,@Username nvarchar(50)
|
||||
,@LocalOnly bit
|
||||
,@NonLinear bit
|
||||
,@CalibrationRecords nvarchar(255)
|
||||
,@ModifyDate datetime
|
||||
,@IsProportional bit
|
||||
,@RemoveOffset bit
|
||||
,@ZeroMethod nvarchar(255)
|
||||
,@CertificationDocuments nvarchar(2048)
|
||||
,@InitialOffset nvarchar(50)
|
||||
,@SensitivityInspection int = null
|
||||
,@CalibrationNote nvarchar(2048) = null
|
||||
,@UsageCount int = null
|
||||
,@errorNumber int output
|
||||
,@errorMessage nvarchar(250) output
|
||||
AS
|
||||
BEGIN
|
||||
set @errorNumber = 0
|
||||
set @errorMessage = space(0)
|
||||
|
||||
if(@SensorSerialNumber is null)
|
||||
begin
|
||||
set @errorNumber = 15600
|
||||
set @errorMessage = 'An invalid parameter or option was specified for procedure'
|
||||
end
|
||||
else
|
||||
begin
|
||||
declare @SensorId int
|
||||
declare @CalibrationTypeId int
|
||||
|
||||
set @SensorId = dbo.foo_IdGetSensor(@SensorSerialNumber)
|
||||
set @CalibrationTypeId = [dbo].[foo_IdGetCalibrationType](@NonLinear, @CalibrationRecords)
|
||||
|
||||
|
||||
UPDATE [dbo].[SensorCalibrations]
|
||||
SET [CalibrationDate] = @CalibrationDate
|
||||
,[Username] = @Username
|
||||
,[LocalOnly] = @LocalOnly
|
||||
,[NonLinear] = @NonLinear
|
||||
,[CalibrationRecords] = @CalibrationRecords
|
||||
,[ModifyDate] = @ModifyDate
|
||||
,[IsProportional] = @IsProportional
|
||||
,[RemoveOffset] = @RemoveOffset
|
||||
,[ZeroMethod] = @ZeroMethod
|
||||
,[CertificationDocuments] = @CertificationDocuments
|
||||
,[InitialOffset] = @InitialOffset
|
||||
,[SensitivityInspection] = @SensitivityInspection
|
||||
,[CalibrationNote] = @CalibrationNote
|
||||
,[UsageCount] = @UsageCount
|
||||
|
||||
WHERE SensorId = @SensorId
|
||||
|
||||
if(@@error!=0)
|
||||
begin
|
||||
set @errorNumber = error_number()
|
||||
set @errorMessage = error_message()
|
||||
end
|
||||
end
|
||||
END
|
||||
Reference in New Issue
Block a user