locked
Attach DB -Error 1830 RRS feed

  • Question

  • User2055357364 posted

    SQL Server 2014

    Weeks ago, I may have moved an .mdf file without first detaching it from SQL Server.

    Today, I need to attach this DB.

    When I select the physical file to attach, two MDFs appear in the activity window (along with the log file), and when I try to complete the process, SQL Server tells me that "A database can only have 1 primary file".

    Furthermore, I see an old path that I need to correct or it states that the file cannot be found...

    Is there an easy fix to overcome this error?

    Friday, June 10, 2016 5:57 PM

Answers

  • User1559292362 posted

    Hi Ms.Longstocking,

    Is there an easy fix to overcome this error?

    As far as I know, A database could have multiple NDF and LDF files but could only have one MDF file. please specify only one MDF file while attaching the database. otherwise, you could change the file name and try attach again.

    Best regards,

    Cole Wu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 13, 2016 6:07 AM

All replies

  • User1559292362 posted

    Hi Ms.Longstocking,

    Is there an easy fix to overcome this error?

    As far as I know, A database could have multiple NDF and LDF files but could only have one MDF file. please specify only one MDF file while attaching the database. otherwise, you could change the file name and try attach again.

    Best regards,

    Cole Wu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 13, 2016 6:07 AM
  • User-236208671 posted

    It seems like you did not rename the Data file and Log File name properly and you are giving both the files same name. Just check that as well..

    DB -->Properties--> Files

    Wednesday, June 15, 2016 7:24 AM