title: Attach Database using Management studio points to the wrong file path for the log file
body: <p>I am trying to attach a SQL server 2000 MDF and LDF which were created on a different machine and attach them to a SQL Server 2008 R2 on different machine. The SQL server files  at the original machine were located at:</p>
  
  <pre><code>C:\DB\SqlServerDataBase.mdf
  D:\Logs\SqlServerDatabase.ldf
  </code></pre>
  
  <p>The 2008 Sql Server machine also contains the same file structure and I place the MDF and LDF files in their appropriate folders:</p>
  
  <pre><code>C:\DB\SqlServerDataBase.mdf
  
  D:\Logs\SqlServerDatabase.ldf
  </code></pre>
  
  <p>When using the SQL Server Management studio Attach Database option, I point to the MDF file however the log file is automatically is  pointed to  C:\DB\SqlServerDatabase.ldf instead of D:\Logs\SqlServerDatabase.ldf and subsequently the attach fails since it can not find the log file.</p>
  
  <p>Interesting thing is if I use :</p>
  
  <pre><code>EXEC sp_attach_db @dbname =N'SqlServerDataBase',
  
  @filename1=N'C:\DB\SqlServerDataBase.mdf',
  
  @filename2=N'D:\Logs\SqlServerDatabase.ldf';
  </code></pre>
  
  <p>The database is restored and pointing to the correct paths for both MDF and LDF.</p>
  
  <p>Thanks</p>