Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Unable to attach MDF File to sql server Expand / Collapse
Author
Message
Posted Tuesday, February 25, 2014 7:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 8, 2014 11:59 PM
Points: 1, Visits: 113
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)


  Post Attachments 
ErrorScreen.docx (22 views, 131.23 KB)
Post #1544911
Posted Tuesday, February 25, 2014 7:38 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 3:20 PM
Points: 18,064, Visits: 16,099
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
Post #1544920
Posted Tuesday, February 25, 2014 9:29 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 6:22 AM
Points: 510, Visits: 1,894
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?
Post #1545004
Posted Monday, May 5, 2014 5:47 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, October 29, 2014 2:23 AM
Points: 45, Visits: 54
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
Post #1567479
Posted Monday, May 5, 2014 9:31 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, October 8, 2014 5:53 PM
Points: 143, Visits: 316
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.
Post #1567566
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse