locked
Database error - files do not match primary RRS feed

  • Question

  • 0

    I have an SQL database anmd a Windows Application in C# in Web developer 2010 express.

    My updates to the database have been working fine until today.

    I ran a set of deletes on a table and then closed the application and opened SQL Management Studio.  When I tried to open the database, I get the following error:

    Failed to retrieve data for this request.
    One or more files do not match the primary file of the database.If you are attempting to attach a database, retry the operation with the correct files.  If this is an existing database, the file may be corrupted and should be restored from a backup.(Microsoft SQL Server Error 5173)

    I have restored the database several times and repeated the operation with the same results.

    I'm not sure what happened to cause this.


    Harry T Ulmer


    Harry T Ulmer

    Thursday, March 8, 2012 9:45 AM

Answers

  • I solved the problem by restoring the database via an sqlscript.  it appears as though using the restore from the management studio

    caused some sort of corruption in the database but usinmg a script solved my problem.

    How do I mark this as solved or remove it?


    Harry T Ulmer

    • Marked as answer by Papy Normand Sunday, March 11, 2012 5:47 PM
    Sunday, March 11, 2012 12:59 PM

All replies

  • sp_helpdb databasename

    send the output.


    Please mark the post as answered to help others to choose the best. chandra sekhar pathivada | www.calsql.com (SQL Server Community Website)

    Friday, March 9, 2012 5:12 PM
  • Is it solved? looks like your primary database file misplaced...


    Cheers!!!

    Vatsa

    www.objectiveprogramming.com


    • Edited by vatsa_mitr Saturday, March 10, 2012 12:16 PM
    Saturday, March 10, 2012 12:15 PM
  • Hello,

    As you are using Web Developer 2010 Express, please, could you provide your connection string and the Edition/version of your SQL Server ?

    If you have user instance = true , a moderator will move your thread towards the SQL Server Express Forum. For more quick informations, i would suggest to have a look at the sticky posts of Mike Wachal at the beginning of the list of the threads of the SQL Server Express Forum. Mike has explained already this problem ( at least ).

    We are waiting for your feedback to try to help you more efficiently.

    Have a nice day

    PS : the move to the SQL Server Express Forum is easy to understand : this problem may occur only with the Express edition and it is the habit to find this kind of problem in this forum.


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    Saturday, March 10, 2012 7:24 PM
  • I solved the problem by restoring the database via an sqlscript.  it appears as though using the restore from the management studio

    caused some sort of corruption in the database but usinmg a script solved my problem.

    How do I mark this as solved or remove it?


    Harry T Ulmer

    • Marked as answer by Papy Normand Sunday, March 11, 2012 5:47 PM
    Sunday, March 11, 2012 12:59 PM
  • Hello harrytu,

    It is easy to mark a post as answer . You have only to click on the button "Mark As Answer" for the post which gives you the solution ( in your case, your last post ). I will do it for you.

    Anyway, thanks to have shared your solution ( so simple when the people have the reflex to do backups frequently ) because too many original posters ( = creator of a thread ) "forget" to provide their solutions.

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    Sunday, March 11, 2012 5:47 PM