Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: deleting an invalid database Date: Tue, 11 Sep 2012 23:19:18 +0200 Organization: Erland Sommarskog Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="9c1143bfab35549403b85d70ea1a57d8"; logging-data="3194"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ELW8Ir5ZoCnJTmxbwmnlT" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:+cfs1wnGipLBYfxbsIjv+PODQx8= Xref: csiph.com comp.databases.ms-sqlserver:1278 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