Could you please advise the PowerShell code which copies one database into another within the same elastic pool?
I was trying to use
- New-AzureRmSqlDatabaseCopy, but the execution failed because New-AzureRmSqlDatabaseCopy is not intended to work with the elastic pools.
- How to Execute and Store Transact-SQL (T-SQL) Query Results in a PowerShell Array, but it errorred out with the time-out exception.
- Invoke-Sqlcmd also failed with Invoke-Sqlcmd : Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding exception.
Here is what I need:
- Copy the database within the same elastic pool. I use "CREATE DATABASE [Database_Name_02] AS COPY OF [Database_Name_01]" T-SQL script when I do it manually.
- Obtain notification when it is copied (it takes about 5-7 mins to copy) or error message when it fails.
Thank you very much for your help, in advance!!!