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,608 of 19,505   
   Erland Sommarskog to Gene Wirchenko   
   Re: Moving a Database   
   03 May 12 07:21:14   
   
   XPost: microsoft.public.sqlserver.programming   
   From: esquel@sommarskog.se   
      
   Gene Wirchenko (genew@ocis.net) writes:   
   >      I want to be able to slurp the whole database so that I will be   
   > able to get a copy of the production data for debugging use.  On the   
   > current system, when there are problems, my boss may send a copy of   
   > the database with instructions to look at certain rows.  This makes it   
   > much easier to replicate trouble, and is not very difficult for him to   
   > do.   
   >   
   >      So what is the best way of doing this?  I am getting conflicting   
   > data.   
      
   BACKUP DATABASE db TO DISK = '' WITH INIT   
      
   RESTORE DATABASE db FROM DISK '' WITH   
      MOVE '' TO '',   
      MOVE '' TO '',   
      REPLACE   
      
   You find name1 and name2 by running sp_helpdb on the source database. You   
   can also use one of RESTORE HEADERONLY or RESTORE FILELISTONLY. (I never   
   remember which is which.) These are logical names for the database files.   
      
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Books Online for SQL Server 2005 at   
   http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx   
   Books Online for SQL Server 2000 at   
   http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx   
      
   --- 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