we can use the query according to our system requirement for example i have my system configuration like below:
os :windows 2003 server
sql server: 2005
ms excel: 2007
i select data from excel using the following configuration and query.
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
SELECT * FROM
OPENROWSET
(
'MICROSOFT.ACE.OLEDB.12.0',
'EXCEL 12.0;DATABASE=D:example.XLSX;',
'SELECT * FROM [SHEET1$]'
)