Hi,
Check This
if (@object_type='OTP' and (@transaction_type='A' or @transaction_type='U'))
begin
If 1 < (SELECT count(T0.U_Shade) FROM [dbo].[@OTP] T0
where T0.U_Shade in (SELECT T1.U_Shade FROM [dbo].[@OTP] T1 WHERE T1.Code = @list_of_cols_val_tab_del ))
Begin
SET @error = 'OTP 001'
SET @error_message = 'Duplicate Shade Not Allowed'
End
end
Thanks,
Nithi