07-09-15, 08:28 #1Registered User
- Join Date
- Jul 2015
Unanswered: SQL Server database corrupt causing problems
We use SQL Server 2008. We have 5 databases. One database is corrupt. When loading SQL Server Management Studio, we cannot expand to see all the databases. SSMS hangs. Any attempt to detach the corrupt database brings a database in use error. The server is a workstation. We changed the name of the computer a few weeks ago. I'm not sure if that has any affect. The database became corrupt while trying to replace the mdf file from a backup mdf. Any ideas?
07-09-15, 08:45 #2Resident Curmudgeon
Provided Answers: 54
- Join Date
- Feb 2004
- In front of the computer
Replacing an MDF file corrupts a database, and there is no direct fix for that.
If you have a BAK file created by a SQL Server backup, restoring that BAK file ought to fix the corruption.
If you have a full set of database files (MDF, LDF, and zero or more NDF files) that were quiesced (which is possible but VERY unlikely), there is a chance that stopping the SQL Server and replacing those files could fix the corruption.
Once you get the corruption fixed, then you can deal with the problems associated with renaming the Windows machine.
-PatPIn theory, theory and practice are identical. In practice, theory and practice are unrelated.