NathanGriffiths
Programmer
Someone has managed to delete the .mdf and .ldf files that contained a database on our system. I have managed to restore what appear to be copies of these files, but I am having problems recreating the database from them.
I've tried:
CREATE DATABASE MyDatabase
ON PRIMARY (FILENAME = 'c:\MyDatabase\MyDatabase_data.mdf')
FOR ATTACH
go
but this gives me an error message:
Server: Msg 906, Level 22, State 2, Line 1
Could not locate row in sysobjects for system catalog 'Sysobjects' in database 'MyDatabase'.
This system catalog should exist in all databases.
Run DBCC CHECKTABLE on sysobjects in this database.
Connection Broken
Obviously I can't run DBCC CHECKTABLE on the database until I've recovered it.
Does anyone have any other suggestions on how I can use the .mdf to recover a database?
thanks,
Nathan Griffiths
I've tried:
CREATE DATABASE MyDatabase
ON PRIMARY (FILENAME = 'c:\MyDatabase\MyDatabase_data.mdf')
FOR ATTACH
go
but this gives me an error message:
Server: Msg 906, Level 22, State 2, Line 1
Could not locate row in sysobjects for system catalog 'Sysobjects' in database 'MyDatabase'.
This system catalog should exist in all databases.
Run DBCC CHECKTABLE on sysobjects in this database.
Connection Broken
Obviously I can't run DBCC CHECKTABLE on the database until I've recovered it.
Does anyone have any other suggestions on how I can use the .mdf to recover a database?
thanks,
Nathan Griffiths