Solved

Removing a SQL Server 2005 Express database

Posted on 2006-07-14
1
232 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Table where row act as column 11 71
Connect remotely to SQL Server DB without TCP/IP enabled? 2 37
SQL Distinct Question 3 15
Need to trim my database size 9 26
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

730 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