SQL excel
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
GO
select * from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0','Excel 8.0;HDR=YES;DATABASE=D:\Project\WorkingFolder\_1.xls',sheet1$)
--or:
/*
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="D:\Project\WorkingFolder\_1.xls";User ID=Admin;Password=;Extended properties=Excel 8.0')...[Sheet1$]
*/
GO
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure
GO
浙公网安备 33010602011771号