Mount mdf file to sql server desktop edition I'm trying to attach a .mdf file to a SQL Server Desktop Edition. 

After reading this I connected to the database using the 

osql -E -S servername\instancename 


command.

I tried to attach the .mdf file with the following command 

EXEC sp_attach_db @dbname = N'mydb', 
     @filename1 = N'C:\Backup\mydb.mdf', 
     @filename2 = N'C:\Backup\mydb.ldf'`


and then I get the following error.


  Msg 602, Level 21, State 50, Server serverName, Line 1
  Could not fine row in sysindexes for database ID 5, object ID 1, index ID 1.


I don't really know what any of this means I have never used osql before.
I suspect this is not a SQL Server 2000 database you are attempting to attach to SQL Server 2000. That appears to be a common cause of the error as indicated here also.

Can you attach this to SQL Server 2005 or 2008 Express and see what error message you get? Do you have access to the underlying database that your files are from? 

I imagine if you attach this to SQL Server 2005 or 2008 you will be able to attach it unless there are other impediments to attach going on that that approach will reveal.