Solved

Removing a SQL Server 2005 Express database

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

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

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 …
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

707 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

13 Experts available now in Live!

Get 1:1 Help Now