ALTER PROCEDURE [dbo].[spAddUpdate_DETAILS_Equipment] @equipment_ID INT=NULL, @seqNO INT=NULL, @manufacturer_ID INT=NULL, @serialNO VARCHAR(50)=NULL, @itemNO VARCHAR(50)=NULL, @modelNO VARCHAR(50)=NULL, @channel_ID INT=NULL, @capacity DECIMAL=NULL, @capacityUnit_ID INT=NULL, @lowerRange DECIMAL=NULL, @upperRange DECIMAL=NULL, @rangeUnit_ID INT=NULL, @description VARCHAR(MAX)=NULL, @active INT=NULL, @createdBy_ID INT=NULL, @updatedBy_ID INT=NULL, @approvedBy_ID INT=NULL AS BEGIN IF EXISTS (SELECT equipment_ID FROM DETAILS_Equipment WHERE equipment_ID = @equipment_ID AND seqNO = @seqNO) BEGIN UPDATE DETAILS_Equipment SET manufacturer_ID = @manufacturer_ID ,itemNO = @itemNO ,modelNO = @modelNO ,capacity = @capacity ,capacityUnit_ID = @capacityUnit_ID ,lowerRange = @lowerRange ,upperRange = @upperRange ,rangeUnit_ID = @rangeUnit_ID ,[description] = @description ,updatedBy_ID = @updatedBy_ID ,dateUpdated = GETDATE() ,approvedBy_ID = @approvedBy_ID WHERE equipment_ID = @equipment_ID AND seqNO = @seqNO END ELSE SET @seqNO = @seqNO + 1 BEGIN INSERT INTO DETAILS_Equipment (equipment_ID ,seqNO ,manufacturer_ID ,serialNO ,itemNO ,modelNO ,channel_ID ,capacity ,capacityUnit_ID ,lowerRange ,upperRange ,rangeUnit_ID ,[description] ,active ,createdBy_ID ,dateCreated ,updatedBy_ID ,dateUpdated ,approvedBy_ID ) VALUES (@equipment_ID ,@seqNO ,@manufacturer_ID ,@serialNO ,@itemNO ,@modelNO ,@channel_ID ,@capacity ,@capacityUnit_ID ,@lowerRange ,@upperRange ,@rangeUnit_ID ,@description ,@active ,@createdBy_ID ,GETDATE() ,@updatedBy_ID ,GETDATE() ,@approvedBy_ID) END RETURN END
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
An Experts Exchange subscription includes unlimited access to online courses.Get Started
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE