Search This Blog

read data from ExcelSheet

1. OpenDataSource
SELECT * INTO #Temp1
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\book1.xls";User ID=;Password=;Extended properties=Excel 5.0')...Sheet1$ --------- note the 3 dots and the '$'

SELECT * FROM #Temp1

2. OPENROWSET

SELECT * INTO #temp
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=c:\book1.xls', Sheet1$)

No comments: