Posts

Showing posts with the label Data Import

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...

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

Image
In this post, we will import a .csv into SQL server. While importing csv can be one of the easiest task that can come over to you as a part of your daily duties of  being a data engineer, sometimes it can require a bit more thinking and efforts. A similar thing came across, where around 50+ large .csv files in a shared location and had to be imported in SQL server and all of them had varying headers which meant destination tables were supposed to have different schemas. Though, there are numerous methods to achieve this for example you create an SSIS package or may be write a PowerShell script to loop through the files, and import them. However, we looked to use SQL Server’s bulk insert command to complete the task. If you have worked with BULK INSERT, you would have noticed that the destination table must be present beforehand. Therefore, the main challenge is that, destination tables with different schemas have to be created dynamically (on the fly) according to th...

Import Data from Sales Force to SQL Server: Part I (Using Alteryx)

Image
Introduction In this post, we will look to perform a task, which is a very common requirement in field of data viz. importing data from Sales Force (a.k.a. SFDC).  We will import data from a sales force table to SQL Server using Alteryx. We need to have access to SFDC.  Step 1:  Open Alteryx and go to Connectors tab on the tools ribbon. Step 2:   Choose SalesForce Input. Drag it on to the canvas. Step 3:  Once you drag the Salesforce input to the canvas, you need to provide following credentials 1)   URL (salesforce URL where the objects are present for data pull) 2)  User Name ( This is your user name using which you access SFDC) 3)  Password ( Your SFDC login’s password) 4)  Security Token Step 4:  Once you provide your credential and connect. Next step is to choose the table.   You can use either the query builder or the custom query option to select the data, which you wish to pull....