Posts

Showing posts with the label Excel

Tips and Tricks for data import into SQL Server – Part II

Image
In this post we will import data from .xlsx file into SQL Server. As with  Tips and Tricks for data import into SQL Server – Part I   , you might think this is a trivial task. You are correct ! However, in this post we will pick a case where we do have to take configuration steps w.r.t. the task at hand before we can actually import data. Our challenge is that we have and 32-bit Microsoft Office 2016 installed on our 64-bit SQL Server and we want to import data from .xlsx file. Let's start by solving one problem at a time as we start to import data from .xlsx file. Below is our .xlsx file placed at a local folder. Step 1: We will try to import using OPENROWSET query SELECT * FROM OPENROWSET ( 'Microsoft.ACE.OLEDB.12.0' , 'Excel 12.0;    Database=C:\Users\.....\SourceFile.xlsx' , 'select * from [Sheet1$]' ) As expected, we will encounter an error. Step 2: We take a clue from the error itself. To resolve we need to enable 'A...