Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I had a SQL Server 2000 MDF on a SQL Server 2005 server (moved from prior version), there was a hardware failure.

After sending harddisk, it was supposed the mdf / ldf files were recovered, but i am unable to attach.

Something curious is that the MDF file has a date on disk from june 2010 and the problem happened in sept 2010. I have tried several options regarding making a new fake db, replace files, mdf, emergency etc, but with no results, can some one help to see how can this be fixed.?

thanks.. eric

see the error below.

*TITLE: Microsoft SQL Server Management Studio
Attach database failed for Server 'SERVERDATA'.  (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0xaaaaaaaa; actual signature: 0x55555556). It occurred during a read of page (1:24) in database ID 7 at offset 0x00000000030000 in file 'C:\sqldata\ipvtelas_Data.MDF'.  Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
Could not open new database 'ipvtelas'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 824)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476*
share|improve this question
After making a dummy db and replace ldf/mdf this is the error –  eric Oct 11 '10 at 0:42
TITLE: Microsoft SQL Server Management Studio ------------------------------ Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) Database 'dummy' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details. (Microsoft SQL Server, Error: 945) –  eric Oct 11 '10 at 0:42
don't post long error messages or stuff like that in comments - it's really hard to read! Instead: update your original question by editing it and provide the additional information there. –  marc_s Oct 11 '10 at 5:01
add comment

migrated from stackoverflow.com Jan 21 '12 at 19:05

This question came from our site for professional and enthusiast programmers.

2 Answers

The fastest, simplest solution is to restore your last good backup. If that isn't an option you can try a workaround to make MSSQL think the database already exists:


Then you can run DBCC and see if it can repair the database, but even in that case you may still have data loss. You could also call Microsoft (maybe you already have a support contract), but the bottom line is that if you have a damaged database and no backup then there's not much that anyone can do.

share|improve this answer
add comment

Most of the Expert database administrators suggest SQL Server Repair Toolbox. It repairs .mdf & .ndf files and supports SQL server 2008 R2, 2008, 2005 & 2000.
Go through this site and solve your problem: http://www.sqlserver.repairtoolbox.com/how-to-repair-an-mdf-file.html

If, this fails to works you may use next:

You can create an empty log file if the LDF is missing or corrupt, or run DBCC CHECKDB, and if there are still errors, run it again with REPAIR_ALLOW_DATA_LOSS (which, obviously, may lose data - but if you had a good backup, you probably wouldn't be asking this).

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.