I'm having a problem inserting data into a table from a temporary table. Basically, I have a temporary table called TEMPADDU25 which contains two columns called SERIALNUMBER and MAILINGTYPE.
I need to get the contents of TEMPADDU25.MAILINGTYPE and insert it into MAILINGPREFERENCE.MAILINGTYPE
I'm using the following SQL script, but am receiving the error:
Cannot insert the value NULL into column 'SERIALNUMBER', table 'dbo.MAILINGPREFERENCE'; column does not allow nulls. INSERT fails.
My SQL script:
INSERT INTO mailingpreference (mailingtype)
WHERE serialnumber=TEMPADDU25.serialnumber .