简体   繁体   English

在 Azure 上使用 BCP 批量导出

[英]Bulk export using BCP on Azure

Within sql server, in a scheduled job, I was using the below command to create a csv file and upload it in a directory.在 sql server 中,在计划的作业中,我使用以下命令创建 csv 文件并将其上传到目录中。

EXEC('EXEC xp_cmdshell ''bcp dbo.sales out "f:\db\salesbackUp\29July2022.csv" -T -c -t"," -C ACP -r\n -S"ICT-SQL02\ICTEPIC"''');

Now, I migrated to azure database ... Is there any solution which will help me run the similar command, so that I can upload the csv file the either to azure storage or any where directly within the sql command.现在,我迁移到了 azure 数据库......有没有任何解决方案可以帮助我运行类似的命令,以便我可以将 csv 文件上传到 azure 存储或直接在 sql 命令中的任何位置。 So that I can create the same scheduled job in azure job database.这样我就可以在天蓝色作业数据库中创建相同的计划作业。

There are multiple approach to execute this but the best you can do by using Azure Data Factory .有多种方法可以执行此操作,但最好的方法是使用Azure Data Factory

Azure Data Factory is a fully managed, serverless data integration service. Azure 数据工厂是一项完全托管的无服务器数据集成服务。

There are two methods:有两种方法:

  1. Using copy activity you can move the data from Azure SQL database to Blob storage.使用copy activity ,您可以将数据从 Azure SQL 数据库移动到 Blob 存储。 Refer Tutorial: Copy data from a SQL Server database to Azure Blob storage请参阅教程:将数据从 SQL Server 数据库复制到 Azure Blob 存储

  2. You can copy multiple tables in bulk using Powershell in Azure Data Factory.可以使用 Azure 数据工厂中的 Powershell 批量复制多个表。 Refer Copy multiple tables in bulk by using Azure Data Factory using PowerShell请参阅使用 PowerShell 使用 Azure 数据工厂批量复制多个表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM