Solved

SQL Express 2008 R2 cannot attach database

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

772 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