--This will shrink all transaction logs
declare @sql varchar(1000)
set @sql = 'IF ''?'' not in (''master'', ''tempdb'', ''model'', ''tempdb'', ''msdb'') BEGIN '
+
'USE ? DBCC SHRINKFILE (N''?_log'' , 0, TRUNCATEONLY)'
+ ' END'
exec sp_msforeachdb @sql
--This will shrink all databases
declare @sql varchar(1000)
set @sql = 'IF ''?'' not in (''master'', ''tempdb'', ''model'', ''tempdb'', ''msdb'') BEGIN '
+
'USE ? DBCC SHRINKDATABASE(N''?'' )'
+ ' END'
exec sp_msforeachdb @sql
No comments:
Post a Comment