Solved

SQL Express 2008 R2 cannot attach database

Posted on 2010-08-30
4
1,223 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
using t-sql EXISTS 8 23
Params not declared?  T-SQL syntax question 3 21
backups - Strategies 1 13
Log Backup 2 13
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now