Unable to attach DB (MSSQL 2005)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziycon
    Contributor
    • Sep 2008
    • 384

    Unable to attach DB (MSSQL 2005)

    I'm getting this error when i try to attach a DB:
    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Attach database failed for Server 'RA-VECTEST'. (Microsoft.SqlS erver.Smo)

    For help, click: http://go.microsoft.co m/fwlink?ProdName =Microsoft+SQL+ Server&ProdVer= 9.00.3042.00&Ev tSrc=Microsoft. SqlServer.Manag ement.Smo.Excep tionTemplates.F ailedOperationE xceptionText&Ev tID=Attach+data base+Server&Lin kId=20476

    ------------------------------
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlS erver.Connectio nInfo)

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

    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)

    For help, click: http://go.microsoft.co m/fwlink?ProdName =Microsoft+SQL+ Server&ProdVer= 09.00.1399&EvtS rc=MSSQLServer& EvtID=5173&Link Id=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------
  • ziycon
    Contributor
    • Sep 2008
    • 384

    #2
    Got it sorted, i removed the .LDF file and attached the .MDF file and let the DB create a new .LDF file.

    Comment

    Working...