SQL query to shrink all log files on sql instance

USE master

exec sp_MSforeachdb '

use [?]
 print ''?''
 print cast(databasepropertyex(''?'', ''Updateability'') as varchar(200))

 if databasepropertyex(''?'', ''Updateability'') = ''READ_WRITE ''

   dbcc shrinkfile(2,1)



Most Popular

DMV To List Foreign Keys With No Index

Easy to use WMI commands to query windows system

Generate SQL script to extract user permissions from a SQL database