Reputation: 3
I am new to Azure. I have a automated process that populates data into a table on Azure SQL Database. Now, I am looking for an automated way of exporting the data out of this table in a CSV format to an On-premises location. (From there the file will be sent to a vendor) By Automation I mean a scheduled process which can run every couple of hours.
How can this be achieved?
Upvotes: 0
Views: 3339
Reputation: 13009
There are good amount of ways to do this:
I am giving powershell script below, which I generally use to quickly get data from a specific table to CSV file. You can schedule this powershell script using task scheduler or using Execute-Process task in SSIS package.
Invoke-sqlcmd -ConnectionString "AzureSQLDBConnectionString" `
-Query "SET NOCOUNT ON;SELECT * FROM TableName" -MaxCharLength 700 `
-QueryTimeout 1200 | Export-Csv -NoTypeInformation -path C:\temp\Tablename.csv -Encoding UTF8
Upvotes: 0
Reputation: 16431
There are many ways can auto export the Azure SQL database table data as a csv file to an on-premise location.
The best way we suggest you is using Data Factory, when the pipeline created, you can create a trigger and schedule execute the pipeline.
Reference:
You also could use bellow ways:
Ref: Azure SQL DB - data file export (.csv) from azure sql
Hope this helps.
Upvotes: 1