Diadem Technologies Support Knowledgebase

Truncate SQL DBs remotely without admin privileges

Article ID: 260
Last updated: 17 May, 2011

SQL Log: It records recent database transactions and is used to ensure database integrity in the event of a system restore, like database queries, updating/insertion/deletion of the records and all other database action. You can say it is a temporary location for database actions and data. Then it finally commits the changes to the database.

For a busy database it’s necessary to truncate the database log frequently to clear the disk space. The SQL log file can grow very large and consume all existing allowed space.

You can truncate the SQL log file remotely without admin privileges,

  • Login “SQL Management Studio” with your database username/password and select the database.
  • Open the “Query” window and run the below script:

USE your_db_name_here
GO
ALTER DATABASE your_db_name_here SET RECOVERY SIMPLE
DBCC SHRINKFILE(2,0)
ALTER DATABASE your_db_name_here SET RECOVERY FULL
GO

You are done!

This article was:  
Report an issue
Article ID: 260
Last updated: 17 May, 2011
Revision: 4
Views: 43416
Comments: 0