My Errors & My Solutions
My Errors & My Solutions - It Could Happen To You
HOW TO take offline a database in SQL Server?
Microsoft Sql Server Management Studio
Microsoft Sql Server Management Studio
Right click on the database node > Tasks > Take Offline
T-SQL Script
Execute the following query
ALTER DATABASE [DatabaseName] SET OFFLINE WITH ROLLBACK IMMEDIATE GO
If it seems that the command doesn’t work or the execution requires more time or to force to take offline or
if you’ll receive the following error:
ALTER DATABASE failed because a lock could not be placed on database ‘{DatabaseName}’. Try again later.
click on the following link to show the Solution:
ALTER DATABASE failed because a lock could not be placed on database
Did my HOW TO help you? Leave a reply.
HOW TO take offline a database in SQL Server
Sergio Castelluccio