Reputation: 11
I created a database with Visual Studio 2008 and I have a file in c:\data.mdf
how I can use it on another computer?
I can't use this database, I installed SQL Server Express 2005 - that install is on the first machine.
Upvotes: 1
Views: 347
Reputation: 873
To move a database from one location to another,
you need to
1. Detach from your source database server: Since you are using Visual Studio 2008 on your source machine, go to Server Explorer - Right click on Databases - Click on Detach.
2. Copy MDF & LDF file to target machine
3. Attach MDF file to your destination database server: Repeat step 1 on target machine's SQL Server, and Instead of Detach - Choose Attach and select the relevant MDF file.
Upvotes: 1
Reputation: 20638
You do not access an mdf file directly, you always go through the server.
To 'tell' Sql Server about the database:
Goto the Object Explorer window.
Right click Databases.
Select Attach...
Then Add...
Upvotes: 0