Reputation: 457
I am developing a software with vb.net 2010 and sql server 2008 R2. While developing with my laptop where sql server is running every thing is ok, but when I want to deliver the project to the customer I must install sql server R2 to customer machine. How to get my database .mdf format to use it with my project. Thankyou
Upvotes: 0
Views: 1196
Reputation: 36421
Just make a backup of your database and restore it on the client's machine.
You can do this either with Visual Studio:
...or with T-SQL:
Detaching and attaching the database (as described in the other answer) is possible too, but the recommended way is making a backup.
Plus, if you are running at least SQL Server 2008 R2 Standard Edition on your laptop, you can use SQL Server's built-in backup compression, which will significantly reduce the size of the backup file (compared to the regular database size).
Upvotes: 1
Reputation: 9322
You need to detach the mdf
file from your computer and then copy that file to your storage device of your choice say a USB. Afterwards if there is already an installed SQL server in your client you could copy the mdf
file that you detach and then attach that mdf
file this time.
To Detach:
Database
that you want to Detach then Task -->
DetachTo Attach:
Don't forget of course to Attach again in your own computer the Database
that you detached earlier.
Upvotes: 1