?
Solved

SQL Express 2008 R2 cannot attach database

Posted on 2010-08-30
4
Medium Priority
?
1,238 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 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

800 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