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,631 of 19,505   
   Tony to All   
   Re: How do I fix this error   
   11 May 12 11:14:08   
   
   From: johansson.andersson@telia.com   
      
   In addition to not finding the mdf file I tried another thing. I just copied   
   the mdf and ldf file to C:\tmp.   
   Now I can attach to the mdf file but when I do so another strange thing   
   accur the database that is   
   listed Under Databases in the SQL Server management Studio now show   
   C:\USERS\TONY\PROGRAMMERING\EXEMPEL\ASPCH09_3_1\APP_DATA\CARSDB.MDF   
   I have thought that it should show C:\TMP\CARSDB.MDF.   
   I don't understand this can anybody explain why the item under Database show   
   this   
   C:\USERS\TONY\PROGRAMMERING\EXEMPEL\ASPCH09_3_1\APP_DATA\CARSDB.MDF   
   instead of this   
   C:\TMP\CARSDB.MDF   
      
   As a summary I have two question   
   My first question why does not the mdf file exist in   
   C:\Users\Tony\programmering\Exempel\ASPCh09_3_1\App_Data ?   
   My second  question when I copied the mdf and ldf file to C:\tmp from   
   C:\Users\Tony\programmering\Exempel\ASPCh09_3_1\App_Data   
   how could the attached mdf file show this   
   C:\USERS\TONY\PROGRAMMERING\EXEMPEL\ASPCH09_3_1\APP_DATA\CARSDB.MDF   
   in the Databases in sql Server Management Studio insted of   
   C:\tmp ?   
      
   //Tony   
      
      
      
      
   >I can't find the mdf file when I try to attach the database in Attach   
   >Database dialog.   
   > I have SQL Server 2008. Here is what I do.   
   > 1. I start Sql Server management studio and use server name:   
   > Alexandra-dator\SQLEXPRESS and Window authentication   
   > 2.I right click on the Database and select attach   
   > 3. I click on Add and try to find my database file that is called   
   > CarsDB.mdf and this file is located at   
   > C:\Users\Tony\programmering\Exempel\ASPCh09_3_1\App_Data\CarsDB.mdf   
   > but I can't find this file   
   >   
   > This is the way that is described in the documentation how it should be   
   > done.   
   > So I wonder what is it that I doing wrong when I can't find the mdf file ?   
   >   
   > //Tony   
   >   
   >   
   >   
   >   
   > "Erland Sommarskog"  skrev i meddelandet   
   > news:XnsA0505C0EC2366Yazorman@127.0.0.1...   
   >> Tony (johansson.andersson@telia.com) writes:   
   >>> It was path problem that I had now it works. But I wonder you mentioned   
   >>> that using the AttachDBFilename was not so good according to you If I   
   >>> have a database called CarsDB.mdf with these setting in web.config how   
   >>> would I write to skip this AttachDBFilename ?   
   >>>   
   >>> The CarsDB.mdf is located in the App_data folder which the DataDirectory   
   >>> is refering to.   
   >>>   
   >>>   
   >>>        
   >>>     
   >>   
   >> Attach the database to the servce once for all and change   
   >> AttachDbFilename   
   >> to Database, strip ".mdf" and take out "User Instance=True".   
   >>   
   >> --   
   >> 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