title: What permissions are needed to copy databases in SQL Azure
body: <p>I wrote a little app to backup SQL Azure databases using the very usefull 'CREATE AS COPY OF' command in SQL Azure.  e.g.</p>
  
  <pre><code>CREATE DATABASE MyNewDB AS COPY OF MyOldDB
  </code></pre>
  
  <p>I run this command with the admin login (first login you get when creating a server).  <strong>My Question: What are the minimal permissions a new login would need to execute the above command?</strong></p>
  
  <p>So far here's what I've done:</p>
  
  <pre><code>-- IN MASTER DB --
  CREATE LOGIN DBCreator WITH PASSWORD = '?????????????'
  CREATE USER DBCreator FROM LOGIN DBCreator;
  EXEC sp_addrolemember 'dbmanager', 'DBCreator';
  
  -- IN MyOldDB --
  -- (I ran this stuff when the previous commands didn't do it) --
  CREATE USER DBCreator FROM LOGIN DBCreator;
  EXEC sp_addrolemember 'db_datareader', 'DBCreator';  -- 
  </code></pre>
  
  <p>And the result when running the above CREATE DATABASE command:</p>
  
  <pre><code>CREATE DATABASE permission denied in database 'MyOldDB'.
  </code></pre>