How To Truncate Your DNN Logs In Your MS SQL Database

How to Truncate your DNN Logs in your MS SQL Database

If you need to clear your DotNetNuke logs directly through the database please follow the steps below.  To perform these steps you will need Microsoft SQL Server Management Studio installed on your computer.  If you do not have Microsoft SQL Server Management Studio installed follow the instructions in the following article: How To Connect To Your MSSQL 2012 Database
  1. Open Microsoft SQL Server Management Studio
  2. Click New Query button
  3. Paste the following Script into the New Query page replacing [database name] with the name of your database
    use [database_name]
    truncate table sitelog
    truncate table eventlog
    truncate table schedulehistory
  4. Click Execute
DNN 7.4.2+
You will need to run the following query in place of 'truncate table eventlog'. As truncate will not work on the Event Log because of Foreign Key Constraints added in 7.4.2.
delete from eventlog
This will clear your DNN site log, event log, and schedule history.

Add Feedback