<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic db from .mdf and ldf files after db deleted in Archive</title>
    <link>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78521#M25703</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Someone completely deleted my SQL Server 7 database.&amp;nbsp; I retrieved the .LDF and .MDF files from a network backup.&amp;nbsp; Now I am trying to attach the database.&amp;nbsp; I have tried this without creating an instance of the database by using the attach stored procedure to attache the .LDF and .MDF files I retrieved from the network backup.&amp;nbsp; Also, I have tried it by creating an instance of the database and doing a detach of the newly created db .LDF and .MDF files and an attach of the .LDF and .MDF files I retrieved from the network backup.&amp;nbsp; Neither of these approaches have worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Mar 2017 13:01:42 GMT</pubDate>
    <dc:creator>ArturKis</dc:creator>
    <dc:date>2017-03-26T13:01:42Z</dc:date>
    <item>
      <title>db from .mdf and ldf files after db deleted</title>
      <link>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78521#M25703</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Someone completely deleted my SQL Server 7 database.&amp;nbsp; I retrieved the .LDF and .MDF files from a network backup.&amp;nbsp; Now I am trying to attach the database.&amp;nbsp; I have tried this without creating an instance of the database by using the attach stored procedure to attache the .LDF and .MDF files I retrieved from the network backup.&amp;nbsp; Also, I have tried it by creating an instance of the database and doing a detach of the newly created db .LDF and .MDF files and an attach of the .LDF and .MDF files I retrieved from the network backup.&amp;nbsp; Neither of these approaches have worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2017 13:01:42 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78521#M25703</guid>
      <dc:creator>ArturKis</dc:creator>
      <dc:date>2017-03-26T13:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: db from .mdf and ldf files after db deleted</title>
      <link>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78522#M25704</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Here is what I have tried in the Query Analyzer, but to no avail:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For the following example, I created a database instance called 'qarun_diamond_48_brett' with brand new .ldf and .mdf files and then tried to detach and then attach the .ldf and .mdf files from the network backup:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;use master&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;go&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sp_detach_db&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'qarun_diamond_48_brett', 'F:\APPS\SQL 7.0\Database\Data\qarun_diamond_48_brett_log.ldf'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Message:&amp;nbsp; Usage: sp_detachdb &amp;lt;dbname&amp;gt;, [TRUE|FALSE]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;use master&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;go&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sp_detach_db&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'qarun_diamond_48_brett', 'F:\APPS\SQL 7.0\Database\Data\qarun_diamond_48_brett.mdf'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Message:&amp;nbsp; Usage: sp_detachdb &amp;lt;dbname&amp;gt;, [TRUE|FALSE]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried the following attaches of the retrieved/recoverd .ldf and .mdf from the network to the newly created db instance.&amp;nbsp; That didn't work, so I tried attaching to a db that had not yet been created.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;use master&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;go&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sp_attach_db&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'qarun_diamond_48_brett2', 'F:\APPS\SQL 7.0\Database\Data\qarun_diamond_48_brett2_log.ldf'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Message: Server: Msg 1801, Level 16, State 3, Line 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Database 'qarun_diamond_48_brett' already exists.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I use a different db name I get the following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Server: Msg 5105, Level 16, State 13, Line 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device activation error. The physical file name 'qarun_diamond_48_brett' may be incorrect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;use master&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;go&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sp_attach_db&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'qarun_diamond_48_brett2', 'F:\APPS\SQL 7.0\Database\Data\qarun_diamond_48_brett2.mdf'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Message: Server: Msg 1801, Level 16, State 3, Line 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Database 'qarun_diamond_48_brett' already exists.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have also tried these statements wtih the EXEC sp_attach_db and EXEC sp_detach_db commands from within the Master db in Query Analyzer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would greatly be appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2017 13:02:11 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78522#M25704</guid>
      <dc:creator>ArturKis</dc:creator>
      <dc:date>2017-03-26T13:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: db from .mdf and ldf files after db deleted</title>
      <link>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78541#M25705</link>
      <description>guys, have any thoughts?</description>
      <pubDate>Tue, 28 Mar 2017 16:33:53 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78541#M25705</guid>
      <dc:creator>ArturKis</dc:creator>
      <dc:date>2017-03-28T16:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: db from .mdf and ldf files after db deleted</title>
      <link>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78543#M25706</link>
      <description>&lt;UL&gt;&lt;LI&gt;First just try replacing the mdf and ldf files with the recovered files. &amp;nbsp;You can stop SQL Server, and move the files in on the O/S level, then restart SQL Server. &amp;nbsp;You might want to do a DBCC CheckDB after that. &amp;nbsp;If this doesn't work...&lt;/LI&gt;&lt;LI&gt;Your Detaches above have syntax errors. &amp;nbsp;To detach the files, use:&lt;BR /&gt;&lt;BR /&gt;sp_detach_db &amp;lt;DatabaseName&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Your DB Name appears to be 'qarun_diamond_48_brett', so&lt;BR /&gt;&lt;BR /&gt;exec sp_detach_db 'qarun_diamond_48_brett'&lt;BR /&gt;&lt;BR /&gt;Your attach needs to specify both files in one command, MDF first. &amp;nbsp;Thus, change it to:&lt;BR /&gt;&lt;BR /&gt;sp_attach_db @DBName = N'qarun_diamond_48_brett2', @filename1 = N'F:\APPS\SQL 7.0\Database\Data\qarun_diamond_48_brett2.mdf',&amp;nbsp;&lt;BR /&gt;@filename2 = N'F:\APPS\SQL 7.0\Database\Data\qarun_diamond_48_brett2_log.ldf'&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 29 Mar 2017 11:14:02 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78543#M25706</guid>
      <dc:creator>kianbarry</dc:creator>
      <dc:date>2017-03-29T11:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: db from .mdf and ldf files after db deleted</title>
      <link>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78544#M25707</link>
      <description>&lt;P&gt;&lt;SPAN&gt;In any case, if these suggestions don't work, you can try to repair .mdf file. You can try MDF Repair Kit. It's not free, but reliable.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.mdf.repair/" target="_blank"&gt;http://www.mdf.repair/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 11:16:58 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78544#M25707</guid>
      <dc:creator>kianbarry</dc:creator>
      <dc:date>2017-03-29T11:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: db from .mdf and ldf files after db deleted</title>
      <link>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78547#M25708</link>
      <description>&lt;P&gt;Thanks for the advice. Your link was very useful for me! Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 18:11:11 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/db-from-mdf-and-ldf-files-after-db-deleted/m-p/78547#M25708</guid>
      <dc:creator>ArturKis</dc:creator>
      <dc:date>2017-03-29T18:11:11Z</dc:date>
    </item>
  </channel>
</rss>

