Microsoft SQL Server
--
Questions
--
Followers
Top Experts
I am deleting a database via SQL Server Management Studio and it is taking a long time. Â The database is offline. Â Any idea how long it might take? Besides SQL Server error logs, is there anything I can do to check the activity and ensure it's not looping or hung (it does indicate it's "Executing")? Â I'd rather not run anything that is going to slow down the delete even more, but I don't want to waste time if it's not actually running. Â I am using RDP to login to the db server. Â I remain logged in, but am toggling back to other windows on my own PC. Â I don't think that affects performance, correct?
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
USE MASTER;
GO
ALTER DATABASE <DBName>
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
DROP DATABASE <DBNAME>;






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
This is very simple issue, bring the database online first.
USE MASTER
GO
ALTER DATBASE <dbname> SET ONLINE
then follow my previous post query to drop the database safely.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
You can cancel it, and give a try using query.
There is something wrong with that database which could be repaired by restarting the server. Dropping an offline database should not be a problem and it should be immediate unless maybe is a huge one.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
what do you mean by deleting the database....
actually deleting the physical/database files ... removing it from the sql server instance
or
deleting the rows from the table(s) in the database but leaving the physical database  still existing...
?
what database recovery model are you using ?
where is the database located ... local disk/SAN ?
how big is it  rows/GB of data...?

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Run sp_who2, this will give the list of sessions currently executing, find out the session with Drop database , take the session Id and run KILL <SessionID> this may takes more time if it needs to rollback the work done by this session earlier.
Can you run DBCC OPENTRAN to check for any open transaction?

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
My objective: reclaim disk space on this server. Â I want to delete all physical files (or as many as possible) associated with this particular database (and corresponding metadata from system tables/databases).
I ran a Delete from SQL Server Mgmt Studio. After 21/2 hours I thought I best ask someone if it's normal for it to take so long. Â That led to my terminating the process. Â Now that I terminated the process, I'd like to know the quickest method to meet my objective (reclaiming disk space) and have some idea how long will it take.
The database is on a dedicated db server, which I am logged on to (as admin). Â The physical .mdf file is about 450mb. Â
Do I proceed as advised and run the SQL statements posted in this stream or start the Delete from Management Studio again (or do something else)? Â How long should it take and is there any way to ensure it is working properly if it's taking a long time?






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
After deleting offline database you have to manually delete the files.
Microsoft SQL Server
--
Questions
--
Followers
Top Experts
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.