# For file excel 2007 version (*.xlsx)
INSERT INTO MyTable
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=D: est.xlsx', [Customer$])
# For file excel 97-2003 version (*.xls)
INSERT INTO MyTable
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D: est.xls', [Customer$])
# For file excel 2007 version (*.xlsx)
INSERT INTO MyTable
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=D: est.xlsx', [Customer$])
# For file excel 97-2003 version (*.xls)
INSERT INTO MyTable
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D: est.xls', [Customer$])
From your SQL Server Management Studio, you open Object Explorer, go to your database where you want to load the data into, right click, then pick Tasks > Import Data.
This opens the Import Data Wizard, which typically works pretty well for importing from Excel.
Step 1 – Create a Project. ...
Step 2 – Create a Connection to your SQL Server Database. ...
Step 3 – Create a Table. ...
Step 4 – Create an Excel Connection. ...
Step 5 – Create a Data Flow Task. ...
Step 6 – Creating the Excel Source. ...
Step 7 – Removing Rubbish Data. ...
Step 8 – Piping the 'OK Data' into a SQL Server Table.
From your SQL Server Management Studio, you open Object Explorer, go to your database where you want to load the data into, right click, then pick Tasks > Import Data.
This opens the Import Data Wizard, which typically works pretty well for importing from Excel.
Step 1 – Create a Project. ...
Step 2 – Create a Connection to your SQL Server Database. ...
Step 3 – Create a Table. ...
Step 4 – Create an Excel Connection. ...
Step 5 – Create a Data Flow Task. ...
Step 6 – Creating the Excel Source. ...
Step 7 – Removing Rubbish Data. ...
Step 8 – Piping the 'OK Data' into a SQL Server Table.