开发者

How to convert an xls file to mysql format?

开发者 https://www.devze.com 2023-04-03 04:45 出处:网络
I have tried the code below: SELECT * INTO NewTablenNmeHere FROM OPENROWSET( \'Microsoft.Jet.OLEDB.4.0\',

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

精彩评论

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