So I need to insert some records from table1 to table2 depending on their user_id (PVKEY) and record_id (CNKEY). Just to explain better, every user has his own unique user_id (PVKEY) and every record has his own record_id (CNKEY). One user can have couple of records but everytime when the new record is added it needs to get new record_id (CNKEY) Everytime I try to insert I get message: "Cannot insert the value NULL into column 'CNKEY', table 'Progress.dbo.CONTHIST'; column does not allow nulls. INSERT fails. The statement has been terminated." Just to be sure that you'll understand the question better: user_id (PVKEY): data and system type is float, primary key FALSE, allow nulls TRUE. record_id (CNKEY): data and system type is float, primary key TRUE, allow nulls FALSE, record_id (CNKEY) exists only in table2 but not in table1 and user_id (PVKEY) exists in both tables. So here is my example that I was trying to execute it without any luck: INSERT INTO dbo.CONTHIST (PVKEY, CONTTYPE, ASSIGNEDTO, CONTDATE, SOURCE, NOTES, CNKEY) SELECT Pvkey, ContactType, AssignedTo, Date, SourceCode, ContactStatus FROM MopUpEOC WHERE PVKEY in (5,7,11)