# 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](https://docs.cloudassert.com/azure-stack-hub-multi-stamp-management/others/configure-vconnect-powershell-modules#install-cloudassert-powershell-modules) for the steps to install / update the CloudAssert.Common PowerShell module.
* Click [here](https://docs.cloudassert.com/azure-stack-hub-multi-stamp-management/others/configure-vconnect-powershell-modules#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
```

![](https://2459906120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3K9Sf115s8edz4tFjuA%2Fuploads%2Fku6O7XJHUBI0j8eyjldN%2FCapture.PNG?alt=media\&token=c60ce8ff-c252-4679-9adf-4c998519832a)

| 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> |
