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')

13 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
  7. Every day I visit a number of blog sites to see content, however this offers quality based content.
    brand strategy firms

    ReplyDelete
  8. MPPSC Coaching in IndoreGet Free MPPSC Notes and MPPSC Study Material for preparation of MPPSC Exam.>

    ReplyDelete
  9. Hi, I have just started to SQL Certification Online. and this blog is really informative for me. Keep us posted for this kind of valuable blog. Thank you for this blog!

    ReplyDelete
  10. I liked your blog because there is a lot of good information in it, if you look for java script in
    Training Services Company in Dinanagar then you will not get anything better than Satyam Technology.

    ReplyDelete