[thelist] Transfer SQL databases on disk

Joel Lieberman joel_lieberman at yahoo.com
Wed Jan 23 06:39:22 CST 2002


Guys -

SQL Server databases can be transported using the
backup and restore methodology, but there is a much
simpler method that has been provided by Microsoft
specifically for the task of transporting databases -
namely, Detach-Attach procedures.

Run sp_detach_db to flush all buffers and detach the
database from the server.  Then simply copy the .MDF
file (you do not need the log since it was closed
during detach) to wherever you need it. Finaly, run
sp_attach_db to bring the database on-line.

Check out these stored procedures in the
documentation.  Detach-Attach is much more direct. 
The restore scenario is technically valid, but is more
complex sytactically, and is meant to be primarily
used for on-line restoration or disaster recovery.

Cheers -

Joel Lieberman
--- ted serbinski <tss24 at cornell.edu> wrote:
> Exactly what I needed. Never even thought of it nor
> how easy it could
> be. Sheesh. Thanks.
> 
> <tip type="health">
> A good trick for losing weight: eat more in the
> first half of the day
> and less in the second half. Your body will have
> more time to burn off
> fat and calories before you hit the hay. So avoid
> those huge pizza runs
> at 2 am and if the hunger won't die down, go healthy
> and get some peanut
> butter + crackers and some milk.
> </tip>
> 
> > > >Is there a way to transfer MS SQL database to a
> disk to save and 
> > > >later put on another machine, all the while
> maintaing tables and 
> > > >data?
> > [...]
> > > (2) make a backup of the database on the
> computer you're 
> > transferring 
> > > data *from*, and then restore the database on
> the other computer.
> > > 
> > > I'm not sure of that, so... well, it's worth a
> try...
> 
> 
> 
> -- 
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt ! 


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/




More information about the thelist mailing list