title: How Can I Remove mdf and ldf File In SQL Server 2008?
body: <p>I have this code:</p>
  
  <pre><code>IF EXISTS (SELECT * FROM sys.sysdatabases WHERE name='MyDatabase')
  begin
     DROP database MyDatabase
  end
  Go
  
  CREATE DATABASE MyDatabase
  </code></pre>
  
  <p>But I see this error after executing this query:</p>
  
  <blockquote>
    <p><em>Cannot create file 'C:\Program Files\Microsoft SQL Server\MSSQL10.FARASQL\MSSQL\DATA\MyDatabase.mdf'</em></p>
  </blockquote>