Truncate SQL DBs remotely without admin privileges

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,

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!



Article ID: 260
Last updated: 17 May, 2011
Revision: 4
Plesk Panel -> Plesk Windows -> Truncate SQL DBs remotely without admin privileges
https://kb.diadem.in/truncate-sql-dbs-remotely-without-admin-privileges_260.html