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: Monday, May 12, 2014 2:45 AM
Points: 1, Visits: 111
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


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 4:51 PM
Points: 21,733, Visits: 15,424
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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1544920
Posted Tuesday, February 25, 2014 9:29 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 6:52 AM
Points: 499, Visits: 1,821
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: Monday, September 8, 2014 7:00 AM
Points: 25, Visits: 41
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, May 7, 2014 10:09 AM
Points: 141, Visits: 313
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