title: Renaming the database and create the database in old name in shows database already exists error
body: <p>I am renaming my database and create the database with an old name in shows database already exist error.</p>
  
  <pre><code>use master 
  
  ALTER DATABASE DATABASE1 
  SET SINGLE_USER WITH ROLLBACK IMMEDIATE 
  
  ALTER DATABASE DATABASE1 
  MODIFY NAME = [DATABASE1_DELETED] 
  
  ALTER DATABASE DATABASE1_DELETED 
  SET MULTI_USER
  </code></pre>
  
  <p>Now the query executed correctly and renamed the database, but again I am trying to create the database with the old name like this:</p>
  
  <pre><code>IF DB_ID('DATABASE1') IS NULL 
     CREATE DATABASE [DATABASE1] 
  </code></pre>
  
  <p>Now it shows an error:</p>
  
  <blockquote>
    <p>Msg 5170, Level 16, State 1, Line 1<br>
    Cannot create file 'C:\Program Files\Microsoft SQL
    Server\MSSQL10_50.EASYDIRECT\MSSQL\DATA\DATABASE1.mdf' because it
    already exists. Change the file path or the file name, and retry the
    operation.<br>
    Msg 1802, Level 16, State 4, Line 1<br>
    CREATE DATABASE failed. Some file names listed could not be created. Check related errors.</p>
  </blockquote>
  
  <p>How can I create the database with the old name?</p>