DBA- Generate Script To Bring All User Databases Offline in SQL Server



Quickly generate script to bring all SQL Server Databases offline.

SELECT 'ALTER DATABASE ['+name+'] SET OFFLINE WITH NO_WAIT'+CHAR(10)+' GO' FROM 
MASTER.sys.databases
WHERE name NOT IN ('master','tempdb','model','msdb','distribution')

8 comments:

  1. Replies
    1. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

      IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

      corporate training in chennai corporate training in chennai

      corporate training companies in india corporate training companies in india

      corporate training companies in chennai corporate training companies in chennai

      I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai Project Centers in Chennai

      Delete
  2. Beautiful simplicity. Perfect!! Thank you.

    ReplyDelete
  3. Nicest information!!! I'll be enchanted to greatly help due to what I've learnt from here.
    user experience design agency

    ReplyDelete
  4. He arrived on time, and expertly investigated and recognized the problem.
    web design SF

    ReplyDelete
  5. This article will outline all the different strategies you should be aware of when it comes to soccer.

    best ias coaching in india

    ReplyDelete
  6. This web page has given me loads to keep in mind and what I wanted for years!! What an extraordinary solution to design studios!!
    company logo design

    ReplyDelete