Server::UserOptions Property

 

Gets the user options for the current connection to the instance of SQL Server.

Namespace:   Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public:
[SfcObjectAttribute(SfcObjectRelationship::ChildObject, SfcObjectCardinality::One)]
property UserOptions^ UserOptions {
	UserOptions^ get();
}

Property Value

Type: Microsoft.SqlServer.Management.Smo::UserOptions^

A UserOptions object that specifies user options for the current connection to the instance of SQL Server.

The UserOptions property points to the UserOptions object. This object can be used to view or modify user-specific settings, such as the ANSI settings, for the instance of SQL Server. The UserOptions object properties contain other settings that you can modify.

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "OS Version =" $srv.Information.OSVersion
Write-Host "State =" $srv.Settings.State.ToString()
Write-Host "Quoted Identifier support =" $srv.UserOptions.QuotedIdentifier
$srv.Settings.LoginMode = [Microsoft.SqlServer.Management.Smo.ServerLoginMode]::Integrated
$srv.UserOptions.AbortOnArithmeticErrors = $TRUE
$srv.Alter()

Server Class
Microsoft.SqlServer.Management.Smo Namespace
Configuring SQL Server (SMO)
Managing Servers

Return to top
Show: