How can I import an Excel file into SQL Server

0 votes

Having data in an Excel file, or since it is 2020, an XLSX file. I need to enter this data into SQL Server in the manner described below:

  1. ad hoc, the use case being feeding tables with test data, or infrequent data loads of small amounts of data (say < 3k rows), and

  2. In a repeatable, robust, and possibly automated way for a production system.

Can someone please help me with this? 

Sep 13 in Database by Kithuzzz
• 20,660 points
191 views

1 answer to this question.

0 votes

You can use OPENROWSET to import an 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$]')

I hope this helps you.

answered Sep 15 by narikkadan
• 37,660 points

Related Questions In Database

0 votes
1 answer

How Can I use "Date" Datatype in sql server?

There's problem in all of them and ...READ MORE

answered Feb 9 in Database by Neha
• 8,940 points
272 views
0 votes
1 answer

How can we achieve excel ceiling function with significance value in SQL Server

If the underlying data types and rounding ...READ MORE

answered Apr 4 in Database by gaurav
• 22,040 points
140 views
0 votes
0 answers

How can I show the table structure in SQL Server query?

Query: SELECT DateTime, Skill, Name, TimeZone, ID, User, ...READ MORE

Aug 11 in Database by Kithuzzz
• 20,660 points
111 views
0 votes
0 answers

How can I delete using INNER JOIN with SQL Server?

In SQL Server 2008, I want to ...READ MORE

Aug 23 in Database by Kithuzzz
• 20,660 points
94 views
+2 votes
1 answer
0 votes
0 answers

How to save the import csv file to mongodb using pyspark (or python)?

I have this code, and I want ...READ MORE

Oct 9, 2019 in Python by Ahmed
• 310 points
1,401 views
0 votes
0 answers

PHP import Excel into database (xls & xlsx)

One of the plugins I looked for ...READ MORE

Jul 30 in PHP by Kithuzzz
• 20,660 points
370 views
0 votes
0 answers

Import CSV file into SQL Server

I have a few fundamental questions and ...READ MORE

Aug 14 in Database by Kithuzzz
• 20,660 points
136 views
0 votes
1 answer

How can I set an SQL Server connection string?

.NET DataProvider -- Standard Connection with username ...READ MORE

answered Sep 19 in Database by narikkadan
• 37,660 points
64 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP