I am writing a service that creates a copy of a certain SQL Azure db every once in a while by issuing this:
CREATE DATABASE [copy] AS COPY OF [original]
I then periodically check the sys.dm_database_copies table to see if the copy is done. Basically, if the dm_database_copies entry is not there, it’s done copying.
What concerns me is the following:
What if the copy failed? Does the dm_database_copies entry get deleted?
My feeling is that is should not get deleted, as it contains info about the error,
but I can’t be sure, because I’ve actually never had a db copy fail.
So the bottom line question is: does the dm_database_copies entry for a particular database id get deleted on anything else than a successful copy?
Many thanks in advance
I had failures in copying large databases (> 100 GB) and the record is not deleted.
From the documentation I read that:
So it implicitly state that if the copy process fails the row is not deleted, according also to my experience.