Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010
    Posts
    4

    Unanswered: Load data into SQL from csv

    Hi all,
    I need to import data from csv to sql table.
    I tried this but this is showing error near the path of the file.can any one tell what is missing or what is wrong in the below query

    LOAD DATA INFILE "c:\test.csv" INTO TABLE F43121
    FIELDS TERMINATED BY ','
    LINES TERMINATED BY '\n'

    Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if you go to the page in da manual for the LOAD DATA command, you will find this small piece of advice:
    Note that Windows pathnames are specified using forward slashes rather than backslashes. If you do use backslashes, you must double them.
    easy to miss, i know
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •