November 20, 2013 at 8:52 am
I faced a problem while detaching and deleting a new database.. I had to close all other processes and tasks(e.g- had to close netbeans) before deleting it..
Is there any alternative??
November 20, 2013 at 8:56 am
ritika rishi (11/20/2013)
I faced a problem while detaching and deleting a new database.. I had to close all other processes and tasks(e.g- had to close netbeans) before deleting it..Is there any alternative??
You can't detach or drop a database that is in use. This is just like any file on your system. You can't delete it when another process has it opened. If you suddenly dropped the database everything that is currently using it will crash.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 20, 2013 at 6:06 pm
If you want to brute force users out and then drop it, you can run:
USE [master]
GO
ALTER DATABASE [db_name] SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE
GO
DROP DATABASE [db_name]
GO
November 21, 2013 at 12:04 am
thank you 🙂
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply