ALTER PROCEDURE [dbo].[sp_SensorsDigitalInGet]
		@SerialNumber nvarchar(50) = null,
		@Id nvarchar(50) = null
AS
BEGIN
	SET NOCOUNT ON;

SELECT [SerialNumber] as 'SettingName'
      ,[SettingMode]
      ,[ScaleMultiplier]
      ,[LastModified]
      ,[LastModifiedBy]
      ,[eId]
      ,[UserValue1]
      ,[UserValue2]
      ,[UserValue3]
      ,[UserTags]
	  ,[MeasurementUnit]
  FROM [dbo].[SensorsDigitalIn] where (@SerialNumber is null or SerialNumber = @SerialNumber ) AND (@Id is null or eId = @Id)
END
