Shrinking the log file script for SQL server database This script mainly for a DBA’s, because most of the time the log file grow again and again and eats up all the disk space and finally an application goes down. Errors from SQL server error log: Error: 9002, Severity: 17, State: 2. The transaction log for database ‘test’ is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases If you got an error “Error: 9002, Severity: 17, State: 2.” like this go and check the log_reuse_wait_desc column in sys.databases by running below command and see what value it returns. SELECT name,…