Saturday 20 May 2017

Stored Procedure for Duplication of Serial Number


IF @transaction_type = 'A' AND @object_type = '176' 

BEGIN

If Exists (SELECT Distinct 'ERROR'  FROM  OINS O1 where o1.internalSN in 
(select o2.internalSN from OINS o2  where o2.insID <>  @list_of_cols_val_tab_del and o2.internalSN = o1.internalSN ) and o1.insID =  @list_of_cols_val_tab_del
)
Begin
SET @error = 1761
SET @error_message = N'Duplication of serial Number!!!'
End
END