Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Removing a SQL Server 2005 Express database

Posted on 2006-07-14
1
Medium Priority
?
244 Views
Last Modified: 2008-03-17
Hi,

I have a SQL Server 2005 Express database on my website. Now I have made some changes to it on my local development machine and would like to replace the online database with my local one. However, when I try to delete the old database files, they cannot be removed.

My ISP does not have a way to detach the database in their web site admin interface. I have tried to remove the web.config file containing the connection string to the database, but no luck. The files has remained write protected for several days now.

Of course I can ask my ISP to remove the database for me, but I would like to know if there is a way to do it myself since I don't want to ask them every time I need to change something.

Thanks!
0
Comment
Question by:10goto20
[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
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 17106750
>However, when I try to delete the old database files, they cannot be removed.
you have to run the following sql:
exec sp_detach_db 'dbname'
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

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.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

604 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