Question: how to import data from excel to sql server table using query?
Answer: SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', SELECT * INTO dbo. ...  FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', EXEC sp_configure 'Show Advanced Options', 1. EXEC sp_configure 'Ad Hoc Distributed Queries', 1. EXEC sp_MSSet_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1.