corrupted mdf File after delete - - An Overclocking Community

Forum Jump: 

corrupted mdf File after delete

Thread Tools
post #1 of 3 (permalink) Old 10-06-2018, 08:08 AM - Thread Starter
Linux Lobbyist
jamrya's Avatar
Join Date: Oct 2018
Location: San Jose
Posts: 1
Rep: 0
corrupted mdf File after delete

Hi guys

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.
jamrya is offline  
Sponsored Links
post #2 of 3 (permalink) Old 10-07-2018, 11:14 PM
Linux Lobbyist
Join Date: Oct 2018
Posts: 1
Rep: 0
Repair Corrupt MDF File

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

Repair command:

Use Master

Note: By using repair allow data loss command, you may lose some data.

If you want to avoid the data loss then, you can repair your MDF file by using third-party SQL database Repair software. I will recommend this software:

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.
RobinShanab is offline  
post #3 of 3 (permalink) Old 10-13-2018, 01:00 PM
Linux Lobbyist
TyYoung's Avatar
Join Date: Oct 2018
Location: Miami
Posts: 1
Rep: 0
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 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.
TyYoung is offline  

Quick Reply

Register Now

In order to be able to post messages on the - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Please enter a password for your user account. Note that passwords are case-sensitive.
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page

Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off