Unable to attach MDF File to sql server

  • Dear All,

    Please help, I'm unable to attach mdf file to the sql server .

    Error Message :

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

  • The error says you have a database already attached with that name.

    Is that true?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • As SQLRUNNR says, the error message is quite straightforward; you already have a database with that name. Were you wanting to restore it rather than to attach it?

  • Go through SSMS to attach MDF file

    1.Right click on Object explorer's Databases and select attach option

    2. A window appears on the screen then click on ADD Button

    3. Then you need to just select the MDF file and then click on OK

    4.Confirm it and again click on ok

    5. Database Add successfully pls check in the Databases list

    SSMS Expert

  • The error clearly mentions that you are trying to attach a database with the same name that already exists. There is nothing wrong with SSMS doing that.

    Good Luck 🙂 .. Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

Viewing 5 posts - 1 through 4 (of 4 total)

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