Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close all connections to a database
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01306154
Message ID:
01306158
Views:
4
>Is there a T-SQL command I can use to close all connections to a database? I want to use the command before I DROP DATABASE MyDb.
>
>Thanks,
>Einar

There is a database setting that automatically closes unused tables. Check ALTER DATABASE command for all the possible settings.

Also I just found an answer by googling:


ALTER DATABASE databaseName
SET SINGLE_USER WITH ROLLBACK IMMEDIATE


or

http://www.experts-exchange.com/Database/Miscellaneous/Q_21314163.html?query=sql+server+force+connections+closed&clearTAFilter=true
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform