Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 copying my database to another offsite computer

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-07-19 : 09:24:27
My need: I want to copy my databse (the file itself) in a mem card so that I can use it in another comuter offsite.
How do I do that. it s like a back up I think, except that I ll need to import the DB in another computer at home.
When I try using Backup the DB of Entreprise Manager, I get violation error, can t copy the file being used or something like that. Am I doing it the right way or is there another better way to do this.

Thanks.

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-07-19 : 09:29:02
There are 2 options for this..

First

If you can detach the database, and take the mdb file it will be good, so that directly you can attach the database.
but for these make sure that all the users will be disconnected who are connected to that database.

Second

Is to take the backup of the database and then restore at the other computer.
It should work fine.

Chirag
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-07-19 : 12:42:29
it worked perfectly. So can t we copy the MDF file without detaching the DB in Entreparise manager.
Thanks.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-07-19 : 16:03:46
quote:
Originally posted by rtutus

it worked perfectly. So can t we copy the MDF file without detaching the DB in Entreparise manager.
Thanks.



Use backup and restore.

CODO ERGO SUM
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-07-19 : 16:05:21
quote:
Originally posted by rtutus

it worked perfectly. So can t we copy the MDF file without detaching the DB in Entreparise manager.
Thanks.



The only way to guarantee that an attach will work is to detach the database or stop the SQL service prior to the copy of the MDF.

I prefer to use BACKUP/RESTORE method as I don't have to take down the database or stop the service. BACKUP/RESTORE allows you to do the move without interrupting the source.

Tara Kizer
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2006-07-20 : 08:20:12
thank you
Go to Top of Page
   

- Advertisement -