开发者

How to convert an xls file to mysql format?

I have tried the code below:

SELECT * INTO NewTablenNmeHere
FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 
'Excel 8.0;Database=C:\testing.xls','SELECT * FROM [Sheet1$]')

I'm getting error:

[Err] 1327 - Undeclared variable: NewTa开发者_高级运维blenNmeHere


OPENROWSET seems to be a MS SQL command. I don't think it has an equivalent in mySQL.

The easiest method that comes to mind is

  • Save the XLS file as CSV
  • Use LOAD DATA INFILE to import the file into mySQL.

You can also use a graphical mySQL client like HeidiSQL to use a point-and-click dialog to determine which column goes where.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜