home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,743 of 19,505   
   Erland Sommarskog to Dom   
   Re: deleting an invalid database   
   11 Sep 12 23:19:18   
   
   edeb0625   
   From: esquel@sommarskog.se   
      
   Dom (dolivastro@gmail.com) writes:   
   > Somehow I got into this situation.  Looking from the OS, I can see two   
   > files, MyDB_Data.MDF, and MyDB_Log.LDF.  This database does not appear   
   > in the SSMS object explorer.  My first thought is, "Attach the   
   > database, then delete it."  But when I try to attach the database, and   
   > I pick the file MyDB_Data.MDF, the "Attach Database" window, claims   
   > the log file is on a non-existent drive.   
   >   
   > First question, "Why does it say that?"  Is the log file path and name   
   > stored in the database?   
      
   Yes.   
      
   > Second, and most important question, "Is it okay to just delete the   
   > MDF and LDF at the level of the OS and forget about it?"  I'm certain   
   > I have no need for the data, because the name is a typical "sandbox"   
   > name.   
      
   If the files are not known to SQL Server, it's seems like a roundabout   
   way to first attach them and drop them, when you can delete them directly.   
      
   But check in sys.databases first.   
      
      
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Links for SQL Server Books Online:   
   SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx   
   SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca