Process_inv SQL Begin transaction; DELETE FROM LIN WHERE LIN_DAD='undefined'; INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(3.00, '8430373140188', 'TABLA SURF EVA LISOS SURT. 104CM.', (select art_med from art where art_ref='8430373140188'), 0, 0, (select art_med * 3.00 from art where art_ref='8430373140188'),(select substring('undefined',1,6)), (select str(substring('undefined',7,10))), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 0, 0, '', 0, 9, 1, 0, 0.000, '', '8430373140188', 0, '1900-01-01', (select cast(getdate()as date)), 'undefined'+str('1',6), 'undefined', 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.00, '8053144395411', 'TAVOLA MARE NYLON+POLISTIROLO CM.93X46X5,2/410gr.', (select art_med from art where art_ref='8053144395411'), 0, 0, (select art_med * 1.00 from art where art_ref='8053144395411'),(select substring('undefined',1,6)), (select str(substring('undefined',7,10))), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 0, 0, '', 0, 9, 2, 0, 0.000, '', '8053144395411', 0, '1900-01-01', (select cast(getdate()as date)), 'undefined'+str('2',6), 'undefined', 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); INSERT INTO LIN (LIN_QNT,ART_REF,LIN_DCR,LIN_PRC,LIN_DSC,LIN_DSC2,LIN_TOT,LIN_TDC,LIN_NUM,LIN_DAT,LIN_IVA,LIN_UNI,LIN_ENT,LIN_QN2,LIN_ACM,LIN_MOV,LIN_LOJ,LIN_FUN,LIN_TAL,LIN_IMP,ESTADO,LIN_LIN,LIN_TDS,LIN_CST,LIN_STK,LIN_REQ,LIN_INT,LIN_VAL,LIN_DMO,LIN_CHV,LIN_DAD,LIN_CNV,LIN_OUT,LIN_ENC,LIN_ORI,LIN_LOT,lin_siva,lin_civa,lin_mem,lin_mot,lin_viva,stk_tdc,lin_agr,dtalt) VALUES(1.00, '8053144395428', 'TAVOLA MARE NYLON+POLISTIROLO CM.101X47X5,5/5', (select art_med from art where art_ref='8053144395428'), 0, 0, (select art_med * 1.00 from art where art_ref='8053144395428'),(select substring('undefined',1,6)), (select str(substring('undefined',7,10))), (select cast(getdate()as date)), 0, 0, 0, 0.000, 'S', '0', 0, 0, '', 0, 9, 3, 0, 0.000, '', '8053144395428', 0, '1900-01-01', (select cast(getdate()as date)), 'undefined'+str('3',6), 'undefined', 0, '', 0, '', 'S/LOTE', 0, 0, '', '', 0, 'N', 0, getdate()); UPDATE DAD SET DAD_MXL=3, DAD_ULT=getdate(), ESTADO=9 WHERE DAD_CHV='undefined' commit transaction : Error converting data type varchar to float.