Error during Attaching DB file

  • Hello

    when we Try to attach the DB files, i can add the first primary datafile(ABC.mdf). when i try to add the next datafile(ABC_1.mdf). It gives me the following error.

    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    M:\ABCDATA2\ABC_1.mdf is not a primary database file. (Microsoft SQL Server, Error: 5171)

    Can some one provide me the solution.

    thanks

  • Actually i had SQL server 2005 in window 2008.

    First, detached the Database.

    Second, Uninstalled sql 2005 and installed sql 2008.

    third, Attached the Database.

    I could attach the first mdf file. when i try to add the second mdf file i get this error.

    (when we Try to attach the DB files, i can add the first primary datafile(ABC.mdf). when i try to add the next datafile(ABC_1.mdf). It gives me the following error.)

    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    M:\ABCDATA2\ABC_1.mdf is not a primary database file. (Microsoft SQL Server, Error: 5171)

    Can some one provide me the solution.

    thanks

  • Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic1038990-1550-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply