Tag: logs

Tech

truncate van alle aanwezige SQL logs

Doeltreffende SQL Query om logfiles te legen. Auteur Paul Hayman DECLARE @DBName varchar(255) DECLARE @LogName varchar(255) DECLARE @DATABASES_Fetch int DECLARE DATABASES_CURSOR CURSOR FOR select distinct name, db_name(s_mf.database_id) dbName from sys.master_files s_mf where s_mf.state = 0 and — ONLINE has_dbaccess(db_name(s_mf.database_id)) = 1 — Only look at databases to which we have access and db_name(s_mf.database_id) not in (‘Master’,’tempdb’,’model’) and […]