简体   繁体   中英

How to backup and restore databases through stored procedure in Azure SQL using Elastic Pool?

I have a C# ASP.NET MVC based web application in which there is a functionality of Archiving (backup) and Restoring Databases on the click of button. Currently, our system is On-Prem and so we are using the stored procedures in SQL Server to do the backup and restore.

Now we are migrating to Azure PaaS and are using Elastic Pool. As the backup and restore T-SQL commands do not work in Azure SQL , so can someone please help me in finding a way to do the backup and restore of DBs manually through T-SQL ?

Any help would be highly appreciated!

Auto backups is a feature of Azure SQL database. 在此处输入图片说明

In SQL Azure, database backups are executed automatically and it is not possible to change this behavior. This is a service offered when you create a SQL Azure database and the first full backup occurs immediately after you create a new SQL Azure database and the rest of the backups are scheduled by SQL Azure itself.

There is no way can help you backup and restore of DBs manually through T-SQL.

Hope this helps.

Thanks for the quick answer,Leon! :)

So that it could be helpful to other community members, I would like to mention another way to achieve the same as it can't be done by T-SQL.

What I have done instead is, I have used SQLPackage.exe utility embedded in a batch script and executed that batch script through my C# code to achieve the same functionality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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