Could not open SQL

Hi! I detached the database, copied its two files testbase.mdf and testbase_log.ldf
Removed everything from the DATA folder that is associated with this database (and indeed everything that was deleted). Copied these files to the DATA folder and tried to attach the database by specifying the file testbase.mdf

Nothing comes out, a message appears at the end of which it says: error 5120

"The action to attach the database failed for the "Server"object (Microsoft.SqlServer.ConnectionInfo)
Exception occurred when executing the Transact-SQL instruction or package
"Failed to open the physical file"

What have I done wrong? In general, how correctly to disconnect a database on one computer that then to attach it already on another?

The database is one-table in 125 lines. If the database can not be attached, then tell me how to extract from it all these very lines to make a new one, completely analogous

thank you in advance!
Holla! -_-

Yeah .... you are extremely hard to understand __))
where are you from ??? )
In such cases, I usually do the following
To restore the Project Server database, you can use the restore feature of Microsoft SQL Server. To do this, follow these steps:
1. Click Start, click AllPrograms, click Microsoft SQL Server, and then click SQL Server Man-agement Studio.
2. In the Connect to Server dialog, the Server Type should be "Database Engine". Check the Server name and Authentication and make changes if needed, then click the Connect button.
3. Expand SQL Server if needed and then expand Databases.
4. Right-click the database, point to All Tasks, and then click Restore then click Database….
5. From the list of backups, click the backup to restore, and then click OK to start the restore.
6. Click OK to confirm that the restore completed successfully.

Well, or in extreme cases, you can try a probe of this to repair sql mdf file, although it does not always help

I hope I helped you;)
Last edited on
Topic archived. No new replies allowed.