从Azure Blob将csv文件插入Azure SQL [英] Insert a csv file into Azure SQL from an Azure Blob

查看:429
本文介绍了从Azure Blob将csv文件插入Azure SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azure中有一个asp.net(c#)网站和一个附带的Azure SQL数据库。我需要上传1gb + csv文件,并得到他们解析,并进入我的Azure SQL数据库。我可以得到csv文件到Azure Blob。我现在有了blob的URL(newGuid.txt)。

I have an asp.net (c#) site in Azure and an accompanying Azure SQL database. I need to upload 1gb+ csv files and get them parsed and into my Azure SQL database. I can get the csv files into an Azure blob. I now have the URL to the blob (newGuid.txt).

从SQL或从网络应用程序,我如何解析这个csv,并把它插入我的Azure SQL数据库? (csv有36列,如果这有帮助)

Either from SQL or from the web app, how do I parse this csv and get it inserted into my Azure SQL database? (the csv has 36 columns if that helps)

我不知道如何引用的URL使用SqlBlukCopy。我最初认为我会BULK INSERT,但Azure SQL不允许这样做。我不能在本地下载文件,并为每个文件使用BCP。

I can't figure out how to reference the URL to use SqlBlukCopy. I initially thought I would BULK INSERT but Azure SQL doesn't allow that. I can't download the files locally and use BCP for each one.

推荐答案

我同意这是一个老问题,获得牵引力,这里是答案:

I agree this is an old question, but as gets traction, here is the answer:

您可以使用 Azure数据工厂将数据从Blob存储(以及更多的数据源)移动到Azure SQL数据库(以及许多其他数据接收器)。

You can use Azure Data Factory to move data from Blob Storage (and many more data sources) to Azure SQL Database (and many other data sinks).

今天没有什么更简单的方法来实现你的目标。以下是一些教程:

There is nothing simpler today to achieve your goal. Here are some tutorials:

  • Move data by using Copy Activity
  • Move data to and from Azure Blob
  • Move data to and from SQL Server running on-premises or on Azure VM (IaaS)

您可以将数据管道配置为只运行一次。或在特定时间运行,或按计划运行。您可以使其复制单个文件,或使用文件模式获取更多文件等。

You can configure a data pipeline to just run once. Or run on specific time, or run on a schedule. You can make it copy single file, or using file pattern to get more files, etc.

这篇关于从Azure Blob将csv文件插入Azure SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆