Settings 类
The Settings object represents a group of configurable settings on the instance of SQL Server.
继承层次结构
System. . :: . .Object
Microsoft.SqlServer.Management.Smo. . :: . .SmoObjectBase
Microsoft.SqlServer.Management.Smo. . :: . .SqlSmoObject
Microsoft.SqlServer.Management.Smo..::..Settings
命名空间: Microsoft.SqlServer.Management.Smo
程序集: Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)
语法
声明
<SfcElementTypeAttribute("Setting")> _
Public NotInheritable Class Settings _
Inherits SqlSmoObject _
Implements IAlterable, IScriptable
用法
Dim instance As Settings
[SfcElementTypeAttribute("Setting")]
public sealed class Settings : SqlSmoObject,
IAlterable, IScriptable
[SfcElementTypeAttribute(L"Setting")]
public ref class Settings sealed : public SqlSmoObject,
IAlterable, IScriptable
[<SealedAttribute>]
[<SfcElementTypeAttribute("Setting")>]
type Settings =
class
inherit SqlSmoObject
interface IAlterable
interface IScriptable
end
public final class Settings extends SqlSmoObject implements IAlterable, IScriptable
Settings 类型公开以下成员。
属性
名称 | 说明 | |
---|---|---|
AuditLevel | Gets or sets the audit level for the instance of Microsoft SQL Server. | |
BackupDirectory | Gets the default backup directory for the instance of Microsoft SQL Server. | |
DefaultFile | Gets or sets the default data file directory for the instance of Microsoft SQL Server. | |
DefaultLog | Gets or sets the default log file directory for the instance of Microsoft SQL Server. | |
ExecuteForScalar | Gets or sets the Boolean property value that specifies whether the object is set to the execute for scalar option. (从 SqlSmoObject 继承。) | |
IsTouched | Gets the Boolean property value that specifies whether the object properties have been updated but not yet persisted on the server. (从 SqlSmoObject 继承。) | |
LoginMode | Gets or sets the logon mode for SQL Server. | |
MailProfile | Gets or sets the mail profile for the instance of SQL Server. | |
NumberOfLogFiles | Gets or sets the number of log files used by databases on the instance of SQL Server. | |
ObjectInSpace | Gets the Boolean property value that specifies whether the object exists in isolation, or whether it is directly or indirectly connected to the instance of SQL Server. (从 SqlSmoObject 继承。) | |
OleDbProviderSettings | References a collection of OleDbProviderSettings objects. Each OleDbProviderSettings object represents an OLE DB provider setting. | |
Parent | Gets the Server object that is the parent of the Settings object. | |
PerfMonMode | Gets the polling behavior of Performance Monitor on the instance of SQL Server. | |
Properties | Gets a collection of Property objects that represent the object properties. (从 SqlSmoObject 继承。) | |
ScalarResult | Gets the scalar result for the referenced object. (从 SqlSmoObject 继承。) | |
State | Gets the state of the referenced object. (从 SmoObjectBase 继承。) | |
TapeLoadWaitTime | Gets or sets the time to wait for a tape to load on a tape backup device. | |
Urn | Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (从 SqlSmoObject 继承。) | |
UserData | Gets or sets user-defined data associated with the referenced object. (从 SmoObjectBase 继承。) |
页首
方法
页首
显式接口实现
名称 | 说明 | |
---|---|---|
IAlienObjectDiscover | (从 SqlSmoObject 继承。) | |
IAlienObjectGetParent | (从 SqlSmoObject 继承。) | |
IAlienObjectGetProperty | (从 SqlSmoObject 继承。) | |
ISfcPropertyProviderGetPropertySet | (从 SqlSmoObject 继承。) | |
IAlienObjectGetUrn | (从 SqlSmoObject 继承。) | |
IAlienObjectResolve | (从 SqlSmoObject 继承。) | |
IAlienObjectSetProperty | (从 SqlSmoObject 继承。) |
页首
注释
后续版本的 Microsoft SQL Server 将删除该功能。 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。
To get Settings object properties, users can be a member of the public fixed server role.
To set Settings object properties, users must be a member of the sysadmin fixed server role.
Thread Safety
此类型的任何公共静态(Microsoft Visual Basic 中的 Shared)成员在多线程操作中是安全的。 不保证所有实例成员都对于线程安全的。
示例
'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Display information about the instance of SQL Server in Information and Settings.
Console.WriteLine("OS Version = " & srv.Information.OSVersion)
Console.WriteLine("State = " & srv.Settings.State.ToString)
'Display information specific to the current user in UserOptions.
Console.WriteLine("Quoted Identifier support = " & srv.UserOptions.QuotedIdentifier)
'Modify server settings in Settings.
srv.Settings.LoginMode = ServerLoginMode.Integrated
'Modify settings specific to the current connection in UserOptions.
srv.UserOptions.AbortOnArithmeticErrors = True
'Run the Alter method to make the changes on the instance of SQL Server.
srv.Alter()
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。