Sql server 2005.mdf.ldf files

I have these 2 files (.MDF and .LDF), how can I attach them to the Microsoft sql server server to see their contents?

+3
source share
5 answers

In Management Studio, in Object Explorer, right-click the Databases folder.

Select "Attach" ...

At the top of the Databases to Join section, click the Add button.

In the displayed folders and files, go to your .mdf file and click on it.

Click OK.

That is all you have to do.

+7
source

SQL (, ). AdventureWorks .

EXEC sp_attach_db @dbname = N'AdventureWorks', @filename1 = N'C:\AdventureWorks_Data.mdf', 
  @filename2 = N'C:\AdventureWorks_log.ldf';

, Windows:

 osql -E -S.\sqlexpress -Q"EXEC sp_attach_db @dbname = N'AdventureWorks', @filename1 = N'C:\AdventureWorks_Data.mdf', @filename2 = N'C:\AdventureWorks_log.ldf'"
+3

, , SQL-, sql "" . node.

+1

SQL Server, , .

, SQL Server 2008 Express SQL Server 2005 Express, .

EDIT: SQL Server, DOK .

0
source

The one who gave you these two files does it wrong. It is much better to back up the database and restore the backup of a new or existing server / instance / database.

0
source

Source: https://habr.com/ru/post/1724225/


All Articles