I have created a database \"test\" with some tables in MS SQL Server 2008 R2 (i.e. MS SQL Server Management Studio).
Now, I need to export this database as a MDF file.>
I think the best way is to create a .bak file from SQL Server .
.bak
Right click on the database => Task => Back Up -> Choose the database in Source , and hit OK .
Task
Back Up
Source
OK