Hi,
Try this
IF (@object_type='10000045') and (@transaction_type='A' or @transaction_type='U')
begin
if exists ( select Itemcode from OSRN where AbsEntry =@list_of_cols_val_tab_del and DistNumber in (select DistNumber from OSRN where AbsEntry <>@list_of_cols_val_tab_del))
select @error =6, @error_message ='Serial exists ' + ( select top 1 DistNumber from OSRN where AbsEntry =@list_of_cols_val_tab_del and DistNumber in (select DistNumber from OSRN where AbsEntry <>@list_of_cols_val_tab_del))
end
Hope this helps,
TVSon