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
 SQL Server 2000 Forums
 MSDE (2000)
 moving a MSDE database

Author  Topic 

willo
Starting Member

1 Post

Posted - 2003-04-14 : 18:54:43
I have created a database that uses the msde engine and have been working on this primarily via dot.net but can also update the database via access. I now want to move my database to a different machine. The old and the new machines are standalone. The new machine has all the required software as I can create a new database on this machine but I cannot find out how I can move my existing database. I have read some articles on wizards etc but there is no interface for MSDE so I am not sure this info applies. I am a very new user to SQL/MSDE so don't skip the basics. Thanks

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2003-04-14 : 19:09:49
go to command prompt and type
osql -U<username> -P<password>
You're cursor should show >1
now type
exec sp_detach_db '<database name>'
you can now zip the .mdf file up and move it around....then go to the machine where you want it. (The .mdf file is the filename that was specified when the database was created, and is probably going to be the same as the database name, but with .mdf on the end.)

Once you've unzipped/saved it, open osql again (obviously with the correct username and password. Then type
exec sp_attach_single_file_db '<datbase name>','C:\.....\bla.mdf'

Let me know how you get on...
--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

Edited by - rrb on 04/14/2003 19:13:20
Go to Top of Page
   

- Advertisement -