Solved

Removing a SQL Server 2005 Express database

Posted on 2006-07-14
1
227 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
1 Comment
 
LVL 142

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calculated columns 13 61
Help with Sorting Full Text results 2 14
SQL VIEW 7 17
sql server group by every 2hrs 5 0
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

911 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

23 Experts available now in Live!

Get 1:1 Help Now