on 02-11-2014 10:39 PM
Buenas tardes, debo realizer un TN que me verifique que no haya nombres repetidos en los socios de negocio de CardType LEAD,, pero no se como puedo validar no por CardCode sino por CardName, alguien me puede guiar para capturer el nombre al momento de crear un Socio de negocio. Gracias por su ayuda.
Prueba esto:
if @object_type='2' and @transaction_type in ('A','U') begin
declare @desc varchar (250)
select @desc=CardName from OCRD where CardType = 'L' and ItemCode = @list_of_cols_val_tab_del
declare @count int
select @count=COUNT(*) from OITM where CardName=@Desc
if (@count > 1) begin
set @error = -1
set @error_message = 'Ya existe un registro con el mismo CardName'
end
end
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.