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)

2 comments:

  1. hi.. just dropping by here... have a nice day! http://kantahanan.blogspot.com/

    ReplyDelete
  2. is this possible to do for excel file instead of csv file?

    ReplyDelete