excel file to sql code example

Example 1: import excel to sql

You can also use OPENROWSET to import excel file in sql server.

SELECT * INTO Your_Table FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
                        'Excel 12.0;Database=C:\temp\MySpreadsheet.xlsx',
                        'SELECT * FROM [Data$]')

Example 2: convert excel to sql

Using SQLizer...
Step 1: Select Excel as your file type
Step 2: Choose the Excel file you want to convert to SQL
Step 3: Select whether the first row contains data or column names
Step 4: Type the name of the Excel worksheet that holds your data
Step 5: Input the cell range of the data that you want to convert
Step 6: Type in a name for your database table
Step 7: Convert your file!

Tags:

Sql Example