I'm clearly missing something . I'm trying to insert a message from the customers table that's specific to that customer into the Invoice when its raised . I can add a process event in my system for that running of the query but , i keep getting an isnull error . I even went and set some default data into the customers table to get around the error but its still there . Clearly i'm being a bit thick . Any help appreciated
insert into salesinvoices (messages) select ISNULL (DC_003_TXT ," " ) from Customers where customerid = 'lagabow_'
"Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'Customer', table 'Training.dbo.SalesInvoices'; column does not allow nulls. INSERT fails.
The statement has been terminated."