Blog Archives

Set autoclose property for all database

in SSMS , Right click on database node in Object Explorer, Select menu item “Start PowerShell” Type in following in power shell window to set Auto Close on all databases dir | foreach {$_.AutoClose = $true; $_.Alter()} If you would

Posted in DB Management, SQL Power shell, SQL Server, SSMS

Index rebuild on large database – SQL Agent Powershell job

Index rebuild on a large database could take longer time. One of our customer was looking for a solution to rebuild index one by one  when index  fragmentation is greater than 30%.  Related  newsgroup thread: In this blog post, I have

Posted in DB Management, Powershell, SQL Agent, SQL Power shell, SQL Server