> For the complete documentation index, see [llms.txt](https://docs.cloudassert.com/azure-stack-hub-multi-stamp-management/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudassert.com/azure-stack-hub-multi-stamp-management/others/troubleshooting/add-transaction-log-shrink-job-in-sql-server.md).

# Add Transaction Log Shrink Job in SQL Server

The following step will help to add a job in SQL Server Agent to shrink the transaction log size in the Database of VConnect, Billing, Hybr and DACM.

* Open a PowerShell window in the SQL Server machine in elevated mode.
* Click [here](/azure-stack-hub-multi-stamp-management/others/troubleshooting/configure-vconnect-powershell-modules.md#install-cloudassert-powershell-modules) for the steps to install / update the CloudAssert.Common PowerShell module.
* Click [here](/azure-stack-hub-multi-stamp-management/others/troubleshooting/configure-vconnect-powershell-modules.md#add-sql-database-connection) for the steps to add a SQL Database Connection.
* Execute the following command to add Transaction Log Shrink Job.

```
Add-SqlTransactionLogShrinkJob
```

![](/files/KLOg55jDlnhc9TqNDcNT)

| Input                                                                                 | Description                                                                                                 |
| ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| SQL Connection Name                                                                   | Name of the SQL database connection created earlier. Ex: `vconnect-sql`                                     |
| Backup folder path                                                                    | The path for saving the database backup and log backup. Ex: C:\\\Backup                                     |
| No.of days to purge old backup                                                        | The number of days to retain the backup                                                                     |
| Hybr Database Name, VConnect Database Name, Billing Database Name, DACM Database Name | <p>Enter 'Y' if it uses the mentioned DB name.<br>Enter 'N' and specify if a different DB name is used.</p> |
