Solved

SQL Express 2008 R2 cannot attach database

Posted on 2010-08-30
4
1,227 Views
Last Modified: 2012-05-10
Hello Experts,

I have a server that has SQL Server Express 2008 R2 installed. The location of the database is D:\Database. When I detach the database using Microsoft SQL Server management Studio, and try to reattach, I am unable to view the database in the "Locate Database Files" windows. I am able to see the D: drive and the databases folder but the application does not see the database and I receive an error even when I enter the database name.

It seems that I am only able to reattach a database that resides on the C: drive. Is there I can reattach my database located on the D: drive? The interesting thing is that I am able to expand the C: drive folders but not on the D: drive.
0
Comment
Question by:katredrum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:tvPrasad
ID: 33561620
It looks like an security issue.

You can try sql to attach your database to see detailed error

      CREATE DATABASE <database_name, sysname, your_database_name>
            ON PRIMARY (FILENAME = '<database_primary_file_path,,C:\Program files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\your_database_name.MDF>')
            FOR ATTACH
GO
0
 
LVL 9

Accepted Solution

by:
shalabhsharma earned 500 total points
ID: 33561624
run the mssqlserver services under local sytem and restart the service and check it again if the problem still persist foryou.

0
 
LVL 1

Author Comment

by:katredrum
ID: 33561676
tvprasad, where do I enter those commands you listed? I am a newbie with SQL.

shalabhsharma, I will change user to "local system" and let you know if it resolved the issue.
0
 
LVL 1

Author Closing Comment

by:katredrum
ID: 33562120
Perfect.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question