1. 程式人生 > >sql語句匯入execl檔案(office2007版)

sql語句匯入execl檔案(office2007版)

use tablename
go
truncate table tablename
go
insert into table(x,x,x,x,x,x)
select x,x,x,x,x,x
from OpenDataSource('Microsoft.Ace.OLEDB.12.0','Data Source="xls檔案路徑";Extended Properties="Excel 12.0;HDR=YES"')...[Excel表名字+$]
go