In this decade of advance technology the availability and usability of optional resources increases day by day and for this Microsoft launched its SQL Server enhanced versions which are easy to handle and maintains SQL database with strong desirability and reliability to provide more comfort to their users. Users created database to maintain information and specific data which was very crucial for him and they need to store their database to the SQL Server in term of security and safety point of view. But the main trouble arises when they do some specific task like migrating or attaching MDF database files to the SQL Server. But Before discussing on how to attach SQL databases to the SQL Server you need to locate the MDF file and Log file to specific database folder. MDF file is root of the SQL database it acts a primary storage where as LDF file is known as the log file which maintains the transactional operations on the SQL database. Both these files are the crucial and necessary files for correct of functioning database.
If you want to attach SQL database MDF file through SQL Server Management studio then you need to connect to an instance of the SQL DB Engines and explore it.
Go to Start button -> All Programs –> MS SQL Server -> SQL Server Management Studio
CREATE DATABASE MyAdventureWorks
ON (FILENAME = 'C:\MySQLServer\AdventureWorks_Data.mdf'),
(FILENAME = 'C:\MySQLServer\AdventureWorks_Log.ldf')
FOR ATTACH;