
DECLARE @nama_tabel VARCHAR(50)

DECLARE list_cursor CURSOR FAST_FORWARD FOR  
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NAME LIKE 'log_%'

OPEN list_cursor  
FETCH NEXT FROM list_cursor INTO @nama_tabel  

WHILE @@FETCH_STATUS = 0  
BEGIN  

	PRINT @nama_tabel
	
	EXEC('TRUNCATE TABLE '+@nama_tabel)

  FETCH NEXT FROM list_cursor INTO @nama_tabel  
END  

CLOSE list_cursor  
DEALLOCATE list_cursor 

