The SQL Log records transaction made into database. These log-entries can be used later to check the actions with database. It also used to ensure database integrity in the event of a system restore, includes but not limited to database queries, updating/insertion/deletion of the records. They are just like a temporary location where SQL Server engine temporary store transactions and at final commits the transaction to the database. To clear the disk space and clean the database log, we need to truncate/trim the database log frequently specially for a very active database. Many times the SQL log file grow very large and consume too much space over server. This might also cause to slow performance of a busy database. Here are steps to trim the SQL log remotely.
- Open Microsoft SQL Server Manager Studio to connect with SQL Database
- Click on your database to select your database
- Create new query
- Now use below T-SQL Script into this newly opened Query windows
- Execute this query by clicking Execute Button or press F5 Key to execute it.
ALTER DATABASE your_db_name_here SET RECOVERY SIMPLE
ALTER DATABASE your_db_name_here SET RECOVERY FULL
Execution of above query done the process.