使用BCP在Azure上出口

发布于 2025-02-11 17:04:59 字数 321 浏览 2 评论 0 原文

在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"''');

现在,我迁移到Azure数据库... 是否有任何解决方案可以帮助我运行类似的命令,因此我可以将CSV文件上传到Azure存储或直接在SQL命令中的任何位置。这样我就可以在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.

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. So that I can create the same scheduled job in azure job database.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北方。的韩爷 2025-02-18 17:04:59

有多种方法可以执行此操作,但是使用 Azure数据工厂可以做到最好。

Azure Data Factory是一家完全管理的无服务器数据集成服务。

有两种方法:

  1. 使用复制活动您可以将数据从Azure SQL数据库移动到BLOB存储。请参阅


  2. 您可以在Azure Data Factory中使用PowerShell批量复制多个表。请参阅使用Azure Data Factory使用Azure Data Factory使用Azure Data Factory复制多个表格powershell

There are multiple approach to execute this but the best you can do by using Azure Data Factory.

Azure Data Factory is a fully managed, serverless data integration service.

There are two methods:

  1. Using copy activity you can move the data from Azure SQL database to Blob storage. Refer Tutorial: Copy data from a SQL Server database to Azure Blob storage

  2. You can copy multiple tables in bulk using Powershell in Azure Data Factory. Refer Copy multiple tables in bulk by using Azure Data Factory using PowerShell

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文