[SQL Server] Tronquer tous les fichiers logs pour toutes les bases
DECLARE @Requete NVARCHAR(MAX)=''
SELECT @Requete = @Requete +'USE '+ QUOTENAME(T2.name)+';'
+'DBCC SHRINKFILE (N'''+ T1.name+''', 0, TRUNCATEONLY);'FROM sys.master_files T1 with (nolock)
JOIN sys.sysdatabases T2 ON T2.dbid=T1.database_id
WHERE T1.type=1 and T2.dbid>4
AND status<>66056
EXECUTE sp_executesql @Requete