How can I import Excel file (.xlsx) into Azure SQL Database - excel

I have data in an Excel file (.xlsx). I have to get this data into Azure SQL Database. Table already exists. I am using Azure Database Studio.
I have tried online query generator but it is mixing up the data.

There are multiple approaches to import Excel file into Azure SQL DB. Below I am showing one approach of using Copy activity in Azure Data Factory.
Sample Excel file with 3 columns.
SQL DB with table having same 3 fields.
Use Excel file as Source.
Use Azure SQL database as Sink.
For mapping click on Import Schema and do the mapping.
Finally run pipeline.
Expected Output:-

Related

Load multiple azure sql tables in to excel sheets

I am trying to extract data from multiple azure sql tables and load into excel file spreadsheets in blob storage.Is there any way to solve this?
You can copy SQL tables to excel using below approach:
Connect Excel to a database in Azure SQL Database.
Click on Get Data. Select Database and Enter credentials.
Now Select database also you need to set firewall rules if you are exporting tables from Azure SQL database.
Refer - https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-excel

Azure Database -> Excel Query

I have a query being executed in a Azure server periodically and I need to add some code to it, so it can save some data from Tables/Views to a Excel file during the execution.
I have implemented some code like this on other databases (non-Azures), but executing the same code in Azure gives me messages like "Azure doesn't support" some of the tools I used.
What should I use to do this? I just got to save some Tables data to specific sheets in Excel.
Thanks in advance!
In case if the requirement is specific to Excel file creation ; you can use a logic app to query database from Azure SQL database and generate Excel file based on the below link:
https://community.dynamics.com/ax/b/d365fortechies/posts/logic-app-for-azure-sql-db-to-azure-file-storage-workflow
Note: You can select Excel file generation for Logic app rather than CSV mentioned in the above example or generate an CSV file and then convert into Excel
Since OPENDATASOURCE is not supported in Azure SQL. You also can use other ETL tools to save some data from Tables/Views to a Excel.
Such as Azure data factory:
Using Copy activity in Azure data factory, you can query from table, execute your sql query and execute stored procudure then convert to a Excel file. There are multiple destinations for you to choose to store this excel, cloud or local server.

Azure Data Lake Excel Export To CSV as Same Folder / Path

have you ever made an azure data convert Azure Data Lake excel conversion to CSV file.
first, I have tried using SSIS with Azure Data Lake Source, but when Mapping is not possible, the choice is to add text.
second, says try using azure apps logic with create CSV table but the csv that comes out is only the structure in that folder
Thank you in advance
There is not a built-in way to extract from excel file in Azure data lake. I would suggest you to try one of the below approaches:
Write Custom .NET library for converting Excel to CSV and deploy that to Azure Data Lake Analytics. Azure Data Lake Analytics Programming Guide
Write a custom .NET activity in Azure Data Factory to do this. Custom Activities in Azure Data Factory
Use Azure Functions and Open XML do this activity as detailed in the stack overflow post
Use SSIS Package to do the conversion. You can have SSIS Runtimes in Azure Data Factory. SSIS packages running in Azure Data Factory
As I know about Azure, These isn't any way can help convert the excel file to csv directly.
You could follow these steps:
Download the excel file to you computer.
Import the excel file to the you SQL database.
Then export the table data as CSV file to you Blob Storage.
You could reference this document:
Import data from Excel to SQL Server or Azure SQL Database
Connect to Azure Blob Storage (SQL Server Import and Export
Wizard)
Hope this helps.

How to decide between Azure Data Lake vs Azure SQL vs Azure Data Lake Analytics vs Azure SQL VM?

I am new to Azure and hence trying to understand what services to use when and how.
At the moment, I have one excel file that has couple of tabs that require some transformation to create one excel file tab (inside the source file itself - say Tab "x"). The final tab "x" created is then being useful for creating one final excel file that is shared to various team.
At present, everything is done manually.
This needs to change and the excel file shared to team has to be automated. The source of the file is the excel file that has various tabs (excluding tab "x") and the reporting tool will be SSRS with excel data being stored in cloud.
Keeping this scenario in mind, what is the best way to store excel data into cloud? The excel data will be stored in cloud on a monthly basis. I am confused as to whether to store data in Azure-SQL, Azure Data Lake Gen 2 or Azure Data Lake Analytics or Azure SQL VM?
Every month data can be fetched from Excel file and populate into Azure using azure data factory. But I am not sure what is the best way to store data in the cloud considering the fact that some ETL process is needed to generate data in format similar to tab "X".
I think you can think about to using Azure SQL database.
Azure SQL database or SQL server support you import data from the excel( or csv) files. For more details and limits, please see: Import data from Excel to SQL Server or Azure SQL Database.
If your data have stored in Azure SQL database, you also can using EXCEL to get the data from Azure SQL database:
Connect Excel to a single database in Azure SQL Database and import data and create tables and charts based on values in the database. In this tutorial you will set up the connection between Excel and a database table, save the file that stores data and the connection information for Excel, and then create a pivot chart from the database values.
Reference: Import data from Excel to SQL Server or Azure SQL Database.
I think you don't need to store these excel files in Azure Data Lake.Azure Data Lake Storage Gen2 is a set of capabilities dedicated to big data analytics, built on Azure Blob storage. It's still a storage.
The more Azure resource you use, the more cost you need to pay.
If your excel file stored in you local computer, you can using Azure Data Factory to access these local files or with self host integration runtime.
Please referenceļ¼š Copy data to or from a file system by using Azure Data Factory.
Hope this helps.
Your storage requirements are very minimal, so I would select Data Lake to store your documents. The alternative is Blob Storage, but I always prefer Data Lake because it works with Azure Active Directory.
In your scenario, drop it in the ADL, and use the ADL as the source in Azure Data Factory.
Edit:
Honestly, your original post is a little confusing. You have a RAW Excel document, you do some transformations on the RAW document, to generate an Excel Source document. This source document holds the final dataset that the dev team will use to build out SSRS reports. You need to make this dataset available to the teams so that they can connect to it to build the reports? My suggestion is to keep it simple and drop the final source dataset in Excel format, into blob or data lake storage and then ask the dev guys to pick it up from the location. If you are going the route of designing and maintaining a data pipeline (Blob > Data Factory > SQL, or CSV, TSV - then you are introducing unnecessary complications.

Convert DBF to CSV using Azure Data Factory

I'm trying to daily load a bunch of tables on Azure SQL DW using Azure Data Factory but I need some help converting DBF tables (to CSV would be nice) prior to loading them up. Can anyone indicate a good way to do this?
You can leverage the custom activity in ADF to covert the DBF files to CSV first. Here's the pointer on how to leverage the custom activity: https://azure.microsoft.com/en-us/documentation/articles/data-factory-use-custom-activities/ . After the CSV files are created use the copy activity in ADF to copy them to Azure SQL DW.
Thanks, Harish

Resources