2011-11-02 35 views
0

我使用下面的代碼加載CSV到數據庫:---的Sql女士:導入CSV到mSQL的數據庫,不能正常工作

LOAD DATA LOCAL INFILE「C:\ Documents和Settings \ vishu.singhvi \桌面\ 5columns.csv '
INTO TABLE digite61new.copy_ENTERPRISEUSER場TERMINATED BY',」 ENCLOSED BY '「' TERMINATED BY LINES '\ n' IGNORE 1線;

但其示出了錯誤: - 'C:\ Documents and Settings \ vishu.singhvi \ Desktop \ 5columns.csv'附近的語法錯誤'

請幫忙。

+1

你的 「MySQL的」 或 「Microsoft SQL Server的」 運行呢?你用兩個標記了它。 –

回答

0

在SQL Server上,不支持此語法。

在MySQL上我不認爲它應該給你看到的錯誤,但你的文件名是錯誤的。

LOAD DATA LOCAL INFILE 'C:\\Documents and Settings\\vishu.singhvi\\Desktop\\5columns.csv' 

documentation

Backslash is the MySQL escape character within strings in SQL statements, so to specify a literal backslash, you must specify two backslashes for the value to be interpreted as a single backslash

+0

感謝您的回答。 。 :)現在它的工作 –

相關問題