--- title: "Set-VESQLIRDatabase" description: "Modifies switchover settings for a specified Microsoft SQL Server database. Product: Veeam Backup & Replication Product Edition: Enterprise, Enterprise Plus, Veeam Universal License This cmdlet allows you to modify the switchover settings for a speci" canonical: "https://helpcenter.veeam.com/docs/vbr/explorers_powershell/set-vesqlirdatabase.html" breadcrumb: "Veeam Explorers PowerShell Reference > Veeam Explorers PowerShell Reference > Veeam Explorer for Microsoft SQL Server > Set-VESQLIRDatabase" dateModified: "2026-08-20" --- # Set-VESQLIRDatabase ## Short Description Modifies switchover settings for a specified Microsoft SQL Server database. **Product**: Veeam Backup & Replication **Product Edition**: Enterprise, Enterprise Plus, Veeam Universal License ## Syntax ``` Set-VESQLIRDatabase [-Database] [-SwitchOverOptions] [] ``` ## Detailed Description This cmdlet allows you to modify the switchover settings for a specified Microsoft SQL Server database. ::: important You can only modify the switchover settings until the moment switchover is automatically triggered (if the `Auto` or `Scheduled` switchover options are selected). ::: ## Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Database

Specifies a published Microsoft SQL Server database within an instant recovery session.

Accepts the VESQLIRDatabase object. To get this object, run the Get-VESQLIRDatabase cmdlet.

VESQLIRDatabase

True

0

True (ByValue)

SwitchOverOptions

Specified a new switchover option for the specified Microsoft SQL Server database.

Accepts the VESQLIRSwitchOverOptions object. To create this object, run the New-VESQLIRSwitchOverOptions cmdlet.

VESQLIRSwitchOverOptions

True

1

True (ByValue)

`` This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the [About Common Parameters](http://go.microsoft.com/fwlink/p/?LinkID=113216) section of Microsoft Learn. ## Examples ::: example ### Setting Scheduled Switchover for Microsoft SQL Server Database This example shows how to set scheduled switchover for the `fiscal` database. The switchover will be performed on `2026-12-4` at `13:00:00`. ``` $time = Get-Date -Date "2026-12-4 13:00:00" $TimeUtc = $time.ToUniversalTime() $ScheduledSwitch = New-VESQLIRSwitchOverOptions -Scheduled -SwitchingTimeUtc $TimeUtc $IRDatabase = Get-VESQLIRDatabase -DatabaseName "fiscal" Set-VESQLIRDatabase -Database $IRDatabase -SwitchOverOptions $ScheduledSwitch ``` Perform the following steps: 1. Run the [`Get-Date`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-date) cmdlet and specify the date and time when the switchover must be performed. Save the result to the `$time` variable. 2. Use the `ToUniversalTime()` method to convert the date and time to the UTC format. Save the result to the `$TimeUTC` variable. 3. Run the [`New-VESQLIRSwitchoverOptions`](new-vesqlirswitchoveroptions.md) cmdlet. Provide the `Scheduled` parameter. Set the `$TimeUTC` variable as the `SwitchingTimeUtc` parameter value. Save the result to the `$ScheduledSwitch` variable. 4. Run the [`Get-VESQLIRDatabase`](get-vesqlirdatabase.md) cmdlet. Specify the `DatabaseName` parameter value. Save the result to the `$IRDatabase` variable. 5. Run the `Set-VESQLIRDatabase` cmdlet. Specify the following options: - Set the `$IRDatabase` variable as the `Database` parameter value. - Set the `$ScheduledSwitch` variable as the `SwitchOverOptions` parameter value. ::: ## Related Commands - [`New-VESQLIRSwitchOverOptions`](new-vesqlirswitchoveroptions.md) - [`Get-VESQLIRDatabase`](get-vesqlirdatabase.md)