SQL NULL vs Empty Strings in CSV
Choose a NULL marker that cannot be confused with a real value. An empty string is a value with no characters. SQL NULL means the value is missing.
Example and result
Enter . CSVsku,note
01,
02,__MISSING__
03,NULLSQL as agreed(`01', ') ⁇ Empty string
('02', NULL)
('03', 'NULL')Set __MISSING__ as the NULL marker. Before converting back, check that the marker is never used as a literal value in that column.
Limits
If the data contains the literal text NULL, using it as the marker would make real and missing values indistinguishable.