I have encountered and odd behavior with the BACKUP MASTER KEY command when using SQL Server 2008 R2 with SP1 (10.50.2500). When I execute the BACKUP command on a UNC path that I do not have write access to I would expect an error. What I have observed and can reproduce is that when I run the command once I receive the Command Executed Successfully message but I do not get my backup because I didn't have write access. Then if I run the same script again I get the appropriate error thrown.Test script used (master key encrypted by the service master key):USE [Master];BACKUP MASTER KEY TO FILE = '\\Networkpath\TDEKey.key' ENCRYPTION BY PASSWORD = 'MySuperSecretPassword123#@!';Once I start to get the error I will continue to get it from re-running the script but I can reproduce the issue if I change the name of the file with the file path remaining the same. Once I alter the file name I will once again get the Completed Successfully and followed by the error on attempt number 2.The only work-around I have found is that local paths do not appear to have this behavior. I did check MSDN and UNC paths are explicitly stated as supported.
Operating System Language
Steps to Reproduce