Friday, September 11, 2009

Import NULL values into MYSQL via "Import CSV"

Try the following in a csv and import it in MYSQL.

NUMERICSTRINGDATE/TIME
"NULL""NULL""NULL"
NULLNULLNULL
/N/N/N
\N\N\N
"/N""/N""/N"
"\N""\N""\N"

The corresponding values that get imported in MYSQL are as follows:



Hence to import NULL values in to MYSQL using import csv method make sure to have entries in CSV file as follows (irrespective of data type) (make sure to make them UPPER CASE):

\N
NULL (Not Recommended)
"\N" (Not Recommended)

1 comment: