如何使用BCP将Azure SQL数据库表/查询导出到Azure数据Blob平面文件? [英] How to export Azure SQL Database tables/query to Azure data blob flat file using BCP?

查看:162
本文介绍了如何使用BCP将Azure SQL数据库表/查询导出到Azure数据Blob平面文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们曾经有一个SQL代理作业在本地SQL服务器上运行,以使用BCP命令将数据导出到txt文件.由于我们要迁移到Azure,因此我想构建一个解决方案以实现相同的目标:

1.应当考虑P 解决方案

嗨琳达,

您仍然可以将BCP与Azure SQL数据库(PaaS)一起使用,但是必须使用Azure Storage Explorer将导出的数据文件(在本地运行BCP时生成)上载到Azure存储.即使将SQL Server实例部署到Azure VM,您也将 需要手动将导出的数据文件手动移动到Azure存储帐户.

是否要求将其完全自动化?如果是这样,您可能会编写PowerShell脚本来实现此自动化.

此致

迈克


We used to have a SQL agent job running on a on-premise SQL server to export data to txt files using BCP command. Since we're moving to Azure, I want to build a solution to achieve the same:

1. Performance should be considered as large amount of data is to be exported, in this case BCP is the fastest.

2. The output txt files will be exported and saved to Azure blob, this one is the most challenging part.

3. Data factory is not preferred because there're dozens of output file format, based on my understanding, 1 file format per DF pipeline sounds tedious.

4. Scheduling part can be replaced by Azure Functions.

Has anyone done similar thing? Any ideas are appreciated!!!

解决方案

Hi Linda,

You can still use BCP but with Azure SQL Database (PaaS) but you will have to upload the exported datafiles (produced when running BCP locally) to Azure Storage using Azure Storage explorer. Even with an SQL Server instance deployed to an Azure VM, you will need to manually move the exported datafile to an Azure Storage account manually. 

Is the requirement that this be fully automated? If so, you could potentially write a PowerShell script to automate this.

Regards,

Mike


这篇关于如何使用BCP将Azure SQL数据库表/查询导出到Azure数据Blob平面文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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