Сжать лог у всех баз на сервере
--select * from [master].[sys].[databases] --where not name in ('master','tempdb','model','msdb') declare @name nvarchar(512) declare @cmd nvarchar(512) DECLARE @Cursor CURSOR SET @Cursor = CURSOR FOR select name from [master].[sys].[databases] where not name in ('master','tempdb','model','msdb') OPEN @Cursor FETCH NEXT FROM @Cursor INTO @name WHILE (@@FETCH_STATUS = 0) BEGIN --print @name set @cmd = 'USE ['+@name+'] GO DBCC SHRINKFILE (N'''+@name+ '_log'', 0, TRUNCATEONLY) GO' print @cmd --exec (@cmd) FETCH NEXT FROM @Cursor INTO @name end