I have those 2 files (.MDF and .LDF) how could i attach them to microsoft sql server in order to see their content ?
In Management Studio, in Object Explorer, right-click on the Databases folder.
Choose Attach...
At the top of the section titled "Databases to attach", click the Add button.
In the displayed folders and files, navigate to your .mdf file and click on it.
Click OK.
That's all you have to do.
Execute this command from SQL command line (such as query analyzer). Replace AdventureWorks with the name you got.
EXEC sp_attach_db @dbname = N'AdventureWorks', @filename1 = N'C:\AdventureWorks_Data.mdf',
@filename2 = N'C:\AdventureWorks_log.ldf';
If you don't have query analyzer handy run this from windows command prompt:
osql -E -S.\sqlexpress -Q"EXEC sp_attach_db @dbname = N'AdventureWorks', @filename1 = N'C:\AdventureWorks_Data.mdf', @filename2 = N'C:\AdventureWorks_log.ldf'"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With