I got a huge problem with mdf repair. One of my employes deleted a MSSQL Database instead of detach. Now i tried to recover the .mdf and .ldf file but when i trie to attach it it says. "File is not a primary database file"
Anybody got an Idea how to fix this? It's very urgent.
Error message "File is not a primary database file" means the MDF file got corrupted. If you have the backup of your database then, restore from it. You can also try to repair your database by using the DBCC CHECKDB repair option. You need to set the database into EMERGENCY mode and then, try to fix it.
ALETR database Your_Database_Name Set Single_User
DBCC CHECKDB (‘Your_Database_Name’, REPAIR_ALLOW_DATA_LOSS)
Note: By using repair allow data loss command, you may lose some data.
This SQL database repair software recommended by SQL experts and Microsoft Most Valuable Professionals. It comes up with the demo version in which, you can check the preview of all recoverable database objects.
Last edited by RobinShanab; 10-07-2018 at 11:20 PM.
Usually most troubles with database can be solved by SQL Server Management Studio
If not, at that time take a look various software over Internet, as an alternative and light can be MDF Repair Kit on address https://www.mdf.repair/ it allows you to get your MDF data without any miss and in several minutes
Last one or fist one way...
Start SQL Server Management Studio
- Click the “Start” button. Move the mouse cursor to the “All Programs” menu, then find and click “Microsoft SQL Server” to open a list of SQL Server programs.
- Click “SQL Server Management Studio” to open the Connect to Server dialog box.
- Select a server on your network. Set the “Authentication” pull-down list to “Windows Authentication” and click the “Connect” button.