0
votes

When I run this query, I get an exception.

INSERT INTO nxt_conge 
            (id_user, 
             etat_conge, 
             date_debut_conge_h, 
             date_fin_conge_h, 
             date_debut_conge_m, 
             date_fin_conge_m, 
             tel_port, 
             id_user_replace, 
             remarque, 
             id_type_conge, 
             begin_time, 
             end_time, 
             externe, 
             destination, 
             id_typetrans, 
             codetype, 
             typetransport, 
             justified, 
             leaveid, 
             id_userabscent, 
             remarque2, 
             autretypeconge, 
             nbre_heure, 
             nbre_jour) 
VALUES     ('1', 
            '0', 
            CONVERT(DATE, '18/08/1436 00:00:00', 103), 
            CONVERT(DATE, '18/08/1436 00:00:00', 103), 
            CONVERT(DATE, '06/06/2015 05:00:00', 103), 
            CONVERT(DATE, '06/06/2015 09:00:00', 103), 
            N'', 
            NULL, 
            N'ddd', 
            '15', 
            '', 
            '', 
            '0', 
            'dd', 
            '0', 
            'CI', 
            '', 
            'True', 
            '0', 
            '0', 
            N'', 
            N'', 
            N'', 
            '0') 

SELECT Scope_identity() 

Error:

Msg 8152, Level 16, State 4, Line 1
String or binary data would be truncated.

1
Check the size of each column against the values that you are trying to insert. - Pரதீப்
thx dude :) codetype is too short ;) - Zied CHAARI

1 Answers

0
votes

Change '15' to 15 , and so for all integer columns