Fix for SQL Server Log Space (Error : 9002) through PowerShell
Scenario: Error : 9002 The Transaction Log for database 'DB' is full due to 'LOG_BACKUP'... One of the most common issue/error faced by developers working with databases i.e., SQL Server, is when LOG size reaches 100% or disk space reaches capacity. Usually this can be resolved by running SQL queries in SSMS to truncate the LOG file, in order words, reducing its size. Let us dive into a specific situation, suppose, there is only one disk in a development environment and the disk space reaches capacity, no programs can be opened e.g. SSMS or even internet browsers. In such a case, we can either increase the disk space or truncate the LOG file using a system utility program, which require minimal temporary storage on disk to execute. One such program is PowerShell and by executing the following commands a quick-fix can be achieved. Prerequisites: 1. Access to the development environment, where the database is housed. 2. Administrator access. Process: On the development...