I have a rather bizarre SQL issue. I am taking data from two tables and copying it across to a third table, before deleting it. This works perfectly well until I reach the number (a key ID number) 22401 and beyond.
I have checked the casts (long) for the recipient table and in the code
I have stepped through the code and it works perfectly fine up to 22401 (id Number, actual record number is 19995), the data is still deleted with the code that follows it up - it is the transfer part of the code that fails - at 22401!
Any advice appreciated, SQL is provided below:
INSERT INTO tblDELETEDCONTACT (CompanyID, Forename, Surname, BusinessName, Address1, Address2, Address3, TownCity, Region, Postcode, Email1, KnowNetwork, LCB, KTP, BusinessGrowth, Chamber, Ezine, DateDeleted, DeletedBy, ContactID ) SELECT tblCOMPANY.CompanyID, tblCONTACT.Forename, tblCONTACT.Surname,tblCOMPANY.BusinessName,tblCOMPANY.Address1,tblCOMPANY.Address2,tblCOMPANY.Address3,tblCOMPANY.TownCity, tblCOMPANY.Region, tblCOMPANY.Postcode, tblCONTACT.Email1, tblCONTACT.KnowNetwork,tblCONTACT.LCB, tblCONTACT.KTP, tblCONTACT.BusinessGrowth,tblCONTACT.Chamber, tblCONTACT.ezine, '19/02/2008 15:42:50' ,'testname', 22401 tblCOMPANY INNER JOIN tblCONTACT ON tblCOMPANY.CompanyID = tblCONTACT.ContactID WHERE (((tblCONTACT.ContactID) =22401));
I have checked the casts (long) for the recipient table and in the code
I have stepped through the code and it works perfectly fine up to 22401 (id Number, actual record number is 19995), the data is still deleted with the code that follows it up - it is the transfer part of the code that fails - at 22401!
Any advice appreciated, SQL is provided below:
INSERT INTO tblDELETEDCONTACT (CompanyID, Forename, Surname, BusinessName, Address1, Address2, Address3, TownCity, Region, Postcode, Email1, KnowNetwork, LCB, KTP, BusinessGrowth, Chamber, Ezine, DateDeleted, DeletedBy, ContactID ) SELECT tblCOMPANY.CompanyID, tblCONTACT.Forename, tblCONTACT.Surname,tblCOMPANY.BusinessName,tblCOMPANY.Address1,tblCOMPANY.Address2,tblCOMPANY.Address3,tblCOMPANY.TownCity, tblCOMPANY.Region, tblCOMPANY.Postcode, tblCONTACT.Email1, tblCONTACT.KnowNetwork,tblCONTACT.LCB, tblCONTACT.KTP, tblCONTACT.BusinessGrowth,tblCONTACT.Chamber, tblCONTACT.ezine, '19/02/2008 15:42:50' ,'testname', 22401 tblCOMPANY INNER JOIN tblCONTACT ON tblCOMPANY.CompanyID = tblCONTACT.ContactID WHERE (((tblCONTACT.ContactID) =22401));