与此post类似,我需要使用查询将数据从Excel电子表格导入新的访问表
是否有与此查询类似的内容用于导入访问数据库
INSERT INTO [tblTemp] ([Column1], [Column2], [Column3], [Column4])
SELECT A.[Column1], A.[Column2], A.[Column3], A.[Column4]
FROM OPENROWSET
('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\Excel.xls;HDR=YES', 'select * from [Sheet1$]') AS A;
答案 0 :(得分:2)
您可以使用以下查询:
SELECT [Column1], [Column2], [Column3], [Column4]
INTO [tblTemp]
FROM [Worsheet1$A2:D122] IN 'D:\Excel.xls' [Excel 8.0;HDR=YES;IMEX=0]
WHERE [Column1] is Not Null;