Server 类

The Server object represents an instance of SQL Server.

继承层次结构

System. . :: . .Object
  Microsoft.SqlServer.Management.Smo. . :: . .SmoObjectBase
    Microsoft.SqlServer.Management.Smo. . :: . .SqlSmoObject
      Microsoft.SqlServer.Management.Smo..::..Server

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
<PhysicalFacetAttribute> _
<RootFacetAttribute(GetType(Server))> _
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
Public NotInheritable Class Server _
    Inherits SqlSmoObject _
    Implements IAlterable, IScriptable, IServerSettings, IServerInformation,  _
    IDmfFacet, IAlienRoot
用法
Dim instance As Server
[PhysicalFacetAttribute]
[RootFacetAttribute(typeof(Server))]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
public sealed class Server : SqlSmoObject, 
    IAlterable, IScriptable, IServerSettings, IServerInformation, IDmfFacet, 
    IAlienRoot
[PhysicalFacetAttribute]
[RootFacetAttribute(typeof(Server))]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
public ref class Server sealed : public SqlSmoObject, 
    IAlterable, IScriptable, IServerSettings, IServerInformation, IDmfFacet, 
    IAlienRoot
[<SealedAttribute>]
[<PhysicalFacetAttribute>]
[<RootFacetAttribute(typeof(Server))>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
type Server =  
    class
        inherit SqlSmoObject
        interface IAlterable
        interface IScriptable
        interface IServerSettings
        interface IServerInformation
        interface IDmfFacet
        interface IAlienRoot
    end
public final class Server extends SqlSmoObject implements IAlterable, IScriptable, IServerSettings, IServerInformation, IDmfFacet, IAlienRoot

Server 类型公开以下成员。

构造函数

  名称 说明
公共方法 Server() () () () Initializes a new instance of the Server class.
公共方法 Server(String) Initializes a new instance of the Server class with the specified name.
公共方法 Server(ServerConnection) Initializes a new instance of the Server class based on the specified connection.

页首

属性

  名称 说明
公共属性 ActiveDirectory Gets information about the Active Directory settings for the instance of SQL Server.
公共属性 AuditLevel Gets or sets the AuditLevel property value.
公共属性 Audits Represents a collection of Audit objects. Each Audit object represents an audit log defined on the instance of SQL Server.
公共属性 BackupDevices Represents a collection of BackupDevice objects. Each BackupDevice object represents a backup device defined on the instance of SQL Server.
公共属性 BackupDirectory Gets or sets the BackupDirectory property value.
公共属性 BrowserServiceAccount Gets the service account that the Browser service runs under on the instance of SQL Server.
公共属性 BrowserStartMode Gets the start mode for the SQL Server Browser Service running on the instance of SQL Server.
公共属性 BuildClrVersion Gets the BuildClrVersion property value.
公共属性 BuildClrVersionString Gets the BuildClrVersionString property value.
公共属性 BuildNumber Gets the BuildNumber property value.
公共属性 Collation Gets the Collation property value.
公共属性 CollationID Gets the CollationID property value.
公共属性 ComparisonStyle Gets the ComparisonStyle property value.
公共属性 ComputerNamePhysicalNetBIOS Gets the ComputerNamePhysicalNetBIOS property value.
公共属性 Configuration Gets the configuration options for the instance of SQL Server.
公共属性 ConnectionContext Gets the current server connection details for the instance of SQL Server.
公共属性 Credentials Represents a collection of Credential objects. Each Credential object represents a credential defined on the instance of SQL Server.
公共属性 CryptographicProviders Gets the CryptographicProviders property value.
公共属性 Databases Represents a collection of Database objects. Each Database object represents a database defined on the instance of SQL Server.
公共属性 DefaultFile Gets or sets the DefaultFile property value.
公共属性 DefaultLog Gets or sets the DefaultLog property value.
公共属性 DefaultTextMode Gets or sets the Boolean property value that specifies whether the default text mode is set for the instance of SQL Server.
公共属性 Edition Gets the Edition property value.
公共属性 Endpoints Represents a collection of Endpoint objects. Each Endpoint object represents an endpoint defined on the instance of SQL Server.
公共属性 EngineEdition Gets the EngineEdition property value.
公共属性 ErrorLogPath Gets the ErrorLogPath property value.
公共属性 Events Gets the server events that are associated with the instance of SQL Server.
受保护属性 ExecuteForScalar Gets or sets the Boolean property value that specifies whether the object is set to the execute for scalar option. (从 SqlSmoObject 继承。)
公共属性 FilestreamLevel
公共属性 FilestreamShareName
公共属性 FullTextService Gets the Microsoft Search Full-Text service implementation for the instance of SQL Server.
公共属性 Information Gets information about the instance of SQL Server.
公共属性 InstallDataDirectory Gets the local Windows directory where the installation data is stored for the instance of SQL Server.
公共属性 InstallSharedDirectory Gets the remote shared directory where the installation data is stored for the instance of SQL Server.
公共属性 InstanceName Gets the instance name of the instance of SQL Server. 
公共属性 IsCaseSensitive Gets the IsCaseSensitive property value.
公共属性 IsClustered Gets the IsClustered property value.
公共属性 IsFullTextInstalled
公共属性 IsSingleUser Gets the IsSingleUser property value.
受保护属性 IsTouched Gets the Boolean property value that specifies whether the object properties have been updated but not yet persisted on the server. (从 SqlSmoObject 继承。)
公共属性 JobServer Gets the SQL Server Agent associated with the instance of SQL Server.
公共属性 Language Gets the Language property value.
公共属性 Languages Represents a collection of Language objects. Each Language object represents an languages supported by the instance of SQL Server.
公共属性 LinkedServers Represents a collection of LinkedServer objects. Each LinkedServer object represents a linked server registered on the instance of SQL Server.
公共属性 LoginMode Gets or sets the ServerLoginMode property value.
公共属性 Logins Represents a collection of Login objects. Each Login object represents a login defined on the instance of SQL Server.
公共属性 Mail Gets the Microsoft SQL Mail service associated with the instance of SQL Server.
公共属性 MailProfile Gets or sets the MailProfile property value.
公共属性 MasterDBLogPath Get the MasterDBLogPath property value.
公共属性 MasterDBPath Gets the MasterDBPath property value.
公共属性 MaxPrecision Gets the MaxPrecision property value.
公共属性 Name Gets the name of the server, which is the physical machine name.
公共属性 NamedPipesEnabled Gets the Boolean value that specifies whether Named Pipes provider is enabled for client-server connectivity on the instance of SQL Server.
公共属性 NetName Gets the NetName property value.
公共属性 NumberOfLogFiles Gets or sets the NumberOfLogFiles property value.
受保护属性 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 Gets the DbProviderSettings property value.
公共属性 OSVersion Gets the OSVersion property value.
公共属性 PerfMonMode Gets or sets the PerfMonMode property value.
公共属性 PhysicalMemory Gets the PhysicalMemory property value.
公共属性 Platform Gets the Platform property value.
公共属性 Processors Gets the Processors property value.
公共属性 Product Gets the Product property value.
公共属性 ProductLevel Gets the ProductLevel property value.
公共属性 Properties Gets a collection of Property objects that represent the object properties. (从 SqlSmoObject 继承。)
公共属性 ProxyAccount Gets the proxy account associated with the instance of SQL Server.
公共属性 ResourceGovernor Gets the ResourceGovernor property value.
公共属性 ResourceLastUpdateDateTime Gets the ResourceLastUpdateDateTime property value.
公共属性 ResourceVersion Gets the ResourceVersion property.
公共属性 ResourceVersionString Gets the ResouceVersionString property value.
公共属性 Roles Represents a collection of ServerRole objects. Each ServerRole object represents a role defined on the instance of SQL Server.
公共属性 RootDirectory Gets the RootDirectory property value.
受保护属性 ScalarResult Gets the scalar result for the referenced object. (从 SqlSmoObject 继承。)
公共属性 ServerAuditSpecifications
公共属性 ServerType Gets the server type for the instance of SQL Server.
公共属性 ServiceAccount Gets the service account under which the instance of SQL Server is running.
公共属性 ServiceInstanceId Gets the ID value that uniquely identifies the service instance for this instance of SQL Server.
公共属性 ServiceMasterKey Gets the service master key associated with the instance of SQL Server.
公共属性 ServiceName
公共属性 ServiceStartMode
公共属性 Settings Gets modifiable settings for the instance of SQL Server.
公共属性 SqlCharSet Gets the SqlCharSet property value.
公共属性 SqlCharSetName Gets the SqlCharSetName property value.
公共属性 SqlDomainGroup
公共属性 SqlSortOrder Gets the SqlSortOrder property value.
公共属性 SqlSortOrderName Gets the SqlSortOrderName property value.
公共属性 State Gets the state of the referenced object. (从 SmoObjectBase 继承。)
公共属性 Status
公共属性 SystemDataTypes Represents a collection of SystemDataType objects. Each SystemDataType object represents a system data type defined on the instance of SQL Server.
公共属性 SystemMessages Represents a collection of SystemMessage objects. Each SystemMessage object represents a system message defined on the instance of SQL Server.
公共属性 TapeLoadWaitTime Gets or sets the TapeLoadWaitTime property value.
公共属性 TcpEnabled
公共属性 Triggers Represents a collection of ServerDdlTrigger objects. Each ServerDdlTrigger object represents a server data definition language (DDL) trigger that is defined on the instance of SQL Server.
公共属性 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 继承。)
公共属性 UserDefinedMessages Represents a collection of UserDefinedMessage objects. Each UserDefinedMessage object represents a user-defined message defined on the instance of SQL Server.
公共属性 UserOptions Gets the user options for the current connection to the instance of SQL Server.
公共属性 Version Gets the Version property value.
公共属性 VersionMajor Gets the VersionMajor property value.
公共属性 VersionMinor Gets the VersionMinor property value.
公共属性 VersionString Gets the VersionString property value.

页首

方法

  名称 说明
受保护方法 AddDatabaseContext (从 SqlSmoObject 继承。)
公共方法 Alter() () () () Updates any Server object property changes on the instance of SQL Server. 
公共方法 Alter(Boolean)
受保护方法 AlterImpl (从 SqlSmoObject 继承。)
受保护方法 AlterImplFinish (从 SqlSmoObject 继承。)
受保护方法 AlterImplInit (从 SqlSmoObject 继承。)
受保护方法 AlterImplWorker (从 SqlSmoObject 继承。)
公共方法 AttachDatabase(String, StringCollection) Attaches an existing database that is made up of one or more files to the instance of SQL Server with the specified name and using the specified data files. 
公共方法 AttachDatabase(String, StringCollection, AttachOptions)
公共方法 AttachDatabase(String, StringCollection, String) Attaches an existing database that is made up of one or more files to the instance of SQL Server with the specified name and using the specified data files. 
公共方法 AttachDatabase(String, StringCollection, String, AttachOptions)
受保护方法 BindDefaultImpl (从 SqlSmoObject 继承。)
受保护方法 BindRuleImpl (从 SqlSmoObject 继承。)
受保护方法 CheckCollation (从 SqlSmoObject 继承。)
受保护方法 CheckObjectState() () () () Validates the state of the referenced object. (从 SqlSmoObject 继承。)
受保护方法 CheckObjectState(Boolean) Validates the state of the referenced object with the option to specify that an exception is thrown if the object is not yet created. (从 SqlSmoObject 继承。)
受保护方法 CheckObjectStateImpl (从 SqlSmoObject 继承。)
受保护方法 CheckVersion100 (从 SqlSmoObject 继承。)
受保护方法 CheckVersion80 Checks the validity of the object on SQL Server 2000. (从 SqlSmoObject 继承。)
受保护方法 CheckVersion80SP3 Checks the validity of the object on SQL Server 2000 SP3. (从 SqlSmoObject 继承。)
受保护方法 CheckVersion90 Check the validity of the object on SQL Server 2005. (从 SqlSmoObject 继承。)
受保护方法 CheckVersionBelow90 (从 SqlSmoObject 继承。)
受保护方法 CleanObject (从 SqlSmoObject 继承。)
公共方法 CompareUrn Compares two URNS.
受保护方法 CreateImpl (从 SqlSmoObject 继承。)
受保护方法 CreateImplFinish (从 SqlSmoObject 继承。)
受保护方法 CreateImplInit (从 SqlSmoObject 继承。)
公共方法 DeleteBackupHistory(DateTime) Deletes the backup history for this instance of SQL Server up until the specified date and time.
公共方法 DeleteBackupHistory(Int32) Deletes the backup history for the specified media set.
公共方法 DeleteBackupHistory(String) Deletes the backup history for the specified database.
公共方法 Deny(ServerPermissionSet, String) Denies the specified set of permissions for the specified grantee on the instance of SQL Server.
公共方法 Deny(ServerPermissionSet, array<String> [] () [] []) Denies the specified set of permissions for the specified grantees on the instance of SQL Server.
公共方法 Deny(ServerPermissionSet, String, Boolean) Denies the specified set of permissions for the specified grantee and other users that the grantee granted the specified set of permissions on the instance of SQL Server.
公共方法 Deny(ServerPermissionSet, array<String> [] () [] [], Boolean) Denies the specified set of permissions for the specified grantees and other users that the grantee granted the specified set of permissions on the instance of SQL Server.
公共方法 DetachDatabase(String, Boolean) Detaches the specified database from the instance of SQL Server with the option to update statistics before the database is detached.
公共方法 DetachDatabase(String, Boolean, Boolean) Detaches the specified database from the instance of SQL Server with the option to update statistics before the database is detached.
公共方法 DetachedDatabaseInfo Returns information about a detached database file.
公共方法 Discover (从 SqlSmoObject 继承。)
受保护方法 DropImpl (从 SqlSmoObject 继承。)
受保护方法 DropImplWorker (从 SqlSmoObject 继承。)
公共方法 EnumActiveCurrentSessionTraceFlags Gets active session flags as a DataTable.
公共方法 EnumActiveGlobalTraceFlags Gets a DataTable that contains active global trace flags.
公共方法 EnumAvailableMedia() () () () Enumerates a list of media that is visible to the instance of SQL Server on the local area network.
公共方法 EnumAvailableMedia(MediaTypes) Enumerates a list of media that is visible to the instance of SQL Server on the local area network and limited to the type of media specified.
公共方法 EnumCollations Enumerates a list of collations supported by the instance of SQL Server.
公共方法 EnumDatabaseMirrorWitnessRoles() () () () Enumerates a list of database mirror witness roles.
公共方法 EnumDatabaseMirrorWitnessRoles(String) Enumerates a list of mirror witness roles for the specified database.
公共方法 EnumDetachedDatabaseFiles Enumerates a list of detached database files.
公共方法 EnumDetachedLogFiles Enumerates a list of detached log files.
公共方法 EnumDirectories Enumerates a list of directories relative to the specified path.
公共方法 EnumErrorLogs Enumerates a list of SQL Server error log files.
公共方法 EnumLocks() () () () Enumerates a list of current locks held on the instance of SQL Server.
公共方法 EnumLocks(Int32) Enumerates a list of current locks held by the specified process on the instance of SQL Server.
公共方法 EnumMembers Enumerates a list of members of server roles and database roles on the instance of SQL Server.
公共方法 EnumObjectPermissions() () () () Enumerates a list of object permissions for the instance of SQL Server.
公共方法 EnumObjectPermissions(String) Enumerates a list of object permissions for a specified grantee on the application instance of SQL Server.
公共方法 EnumObjectPermissions(ObjectPermissionSet) Enumerates a list of object permissions for a specified permission on the instance of SQL Server.
公共方法 EnumObjectPermissions(String, ObjectPermissionSet) Enumerates a list of object permissions for a specified grantee and a specified permission on the instance of SQL Server.
公共方法 EnumPerformanceCounters() () () () Enumerates a list of performance counters that are supported by the instance of SQL Server.
公共方法 EnumPerformanceCounters(String) Enumerates a list of performance counters that are supported by the instance of SQL Server for a specified object.
公共方法 EnumPerformanceCounters(String, String) Enumerates a list of performance counters that are supported by the instance of SQL Server for a specified object and specified counter.
公共方法 EnumPerformanceCounters(String, String, String) Enumerates a list of performance counters that are supported by the instance of SQL Server for a specified object, for a specified counter, and on the specified instance of SQL Server.
公共方法 EnumProcesses() () () () Enumerates a list of processes running on the instance of SQL Server.
公共方法 EnumProcesses(Boolean) Enumerates a list of processes running on the instance of SQL Server with the option to exclude system processes.
公共方法 EnumProcesses(Int32) Enumerates a list of information about the specified process.
公共方法 EnumProcesses(String) Enumerates a list of processes running on the instance of SQL Server that are associated with the specified login.
受保护方法 EnumScriptImpl (从 SqlSmoObject 继承。)
受保护方法 EnumScriptImplWorker (从 SqlSmoObject 继承。)
公共方法 EnumServerAttributes Enumerates a list of server attributes for the instance of SQL Server.
公共方法 EnumServerPermissions() () () () Enumerates a list of server permissions for the instance of SQL Server.
公共方法 EnumServerPermissions(String) Enumerates a list of server permissions for a specified grantee on the instance of SQL Server.
公共方法 EnumServerPermissions(ServerPermissionSet) Enumerates a list of server permissions for a specified permission on the instance of SQL Server.
公共方法 EnumServerPermissions(String, ServerPermissionSet) Enumerates a list of server permissions for a specified grantee and a specified permission on the instance of SQL Server.
公共方法 EnumStartupProcedures Enumerates a list of startup procedures.
公共方法 EnumWindowsDomainGroups() () () () Enumerates a list of Microsoft Windows group accounts defined on a domain.
公共方法 EnumWindowsDomainGroups(String) Enumerates a list of Microsoft Windows group accounts defined for the specified domain.
公共方法 EnumWindowsGroupInfo() () () () Enumerates a list of information about all Microsoft Windows groups that have explicitly granted access to the instance of SQL Server.
公共方法 EnumWindowsGroupInfo(String) Enumerates a list of information about all Microsoft Windows groups that have explicitly granted access to the instance of SQL Server.
公共方法 EnumWindowsGroupInfo(String, Boolean) Enumerates a list of information about all Microsoft Windows groups that have explicitly granted access to the instance of SQL Server and with the option to list the individual members.
公共方法 EnumWindowsUserInfo() () () () Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to SQL Server.
公共方法 EnumWindowsUserInfo(String) Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to the instance of SQL Server.
公共方法 EnumWindowsUserInfo(String, Boolean) Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to the instance of SQL Server and with the option to list all the permissions paths (groups) through which the user has been granted access to the instance of SQL Server.
公共方法 Equals (从 Object 继承。)
受保护方法 Finalize (从 Object 继承。)
受保护方法 FormatSqlVariant (从 SqlSmoObject 继承。)
受保护方法 GenerateDataSpaceFileStreamScript (从 SqlSmoObject 继承。)
受保护方法 GenerateDataSpaceScript (从 SqlSmoObject 继承。)
公共方法 GetActiveDBConnectionCount Returns the number of active connections for the specified database.
受保护方法 GetBindDefaultScript (从 SqlSmoObject 继承。)
受保护方法 GetBindRuleScript (从 SqlSmoObject 继承。)
受保护方法 GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32%) (从 SqlSmoObject 继承。)
受保护方法 GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32%, Boolean) (从 SqlSmoObject 继承。)
受保护方法 GetDateTimeParameter (从 SqlSmoObject 继承。)
受保护方法 GetDateTimeParameterAsInt (从 SqlSmoObject 继承。)
受保护方法 GetDBName Gets the database name that is associated with the object. (从 SqlSmoObject 继承。)
公共方法 GetDefaultInitFields Returns the property types that are initialized by default when the specified object is initialized.
受保护方法 GetEnumParameter (从 SqlSmoObject 继承。)
受保护方法 GetFragOptionString (从 SqlSmoObject 继承。)
受保护方法 GetGuidParameter (从 SqlSmoObject 继承。)
公共方法 GetHashCode (从 Object 继承。)
受保护方法 GetParameter(StringBuilder, ScriptingOptions, String, String, Int32%) (从 SqlSmoObject 继承。)
受保护方法 GetParameter(StringBuilder, ScriptingOptions, String, String, Int32%, Boolean) (从 SqlSmoObject 继承。)
公共方法 GetPropertyNames Returns the names of the initialized properties for the specified object type
受保护方法 GetPropValue (从 SqlSmoObject 继承。)
受保护方法 GetPropValueOptional (从 SqlSmoObject 继承。)
受保护方法 GetPropValueOptionalAllowNull (从 SqlSmoObject 继承。)
受保护方法 GetRealValue (从 SqlSmoObject 继承。)
受保护方法 GetScriptingOptionsForCreate (从 SqlSmoObject 继承。)
受保护方法 GetServerName Gets the name of the instance of SQL Server with which the object is associated. (从 SqlSmoObject 继承。)
受保护方法 GetServerObject (从 SqlSmoObject 继承。)
公共方法 GetSmoObject Gets a SqlSmoObject that is specified by a URN.
受保护方法 GetSqlServerVersionName Gets the version name of the instance of SQL Server with which the object is associated. (从 SqlSmoObject 继承。)
公共方法 GetStringComparer Gets an IComparer interface.
受保护方法 GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32%) (从 SqlSmoObject 继承。)
受保护方法 GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32%, Boolean) (从 SqlSmoObject 继承。)
受保护方法 GetTimeSpanParameterAsInt (从 SqlSmoObject 继承。)
公共方法 GetType (从 Object 继承。)
受保护方法 GetUrnRecursive(StringBuilder) (从 SqlSmoObject 继承。)
受保护方法 GetUrnRecursive(StringBuilder, UrnIdOption) (从 SqlSmoObject 继承。)
公共方法 Grant(ServerPermissionSet, String) Grants the specified set of permissions to the specified grantee on the instance of SQL Server.
公共方法 Grant(ServerPermissionSet, array<String> [] () [] []) Grants the specified set of permissions to the specified grantees on the instance of SQL Server.
公共方法 Grant(ServerPermissionSet, String, Boolean) Grants access to the specified permission to the grantee and the ability to grant access to other users on the instance of SQL Server.
公共方法 Grant(ServerPermissionSet, array<String> [] () [] [], Boolean) Grants access to the specified permission to the grantees and the ability to grant access to other users on the instance of SQL Server.
公共方法 Grant(ServerPermissionSet, String, Boolean, String) Grants the specified set of permissions to the grantee and the ability to grant the set of permissions to other users on the instance of SQL Server under an assumed role.
公共方法 Grant(ServerPermissionSet, array<String> [] () [] [], Boolean, String) Grants the specified set of permissions to the grantees and the ability to grant the set of permissions to other users on the instance of SQL Server under an assumed role.
受保护方法 ImplInitialize (从 SqlSmoObject 继承。)
公共方法 Initialize() () () () Initializes the object and forces the properties be loaded. (从 SqlSmoObject 继承。)
公共方法 Initialize(Boolean) Initializes the object and forces the properties be loaded. (从 SqlSmoObject 继承。)
公共方法 IsDetachedPrimaryFile Verifies whether the specified file is a primary (.mdf) database file.
受保护方法 IsObjectDirty Verifies whether the object properties have been modified and the changes have not yet been persisted on the instance of SQL Server. (从 SqlSmoObject 继承。)
受保护方法 IsObjectInitialized Verifies whether the object has been initialized. (从 SqlSmoObject 继承。)
受保护方法 IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (从 SqlSmoObject 继承。)
受保护方法 IsVersion80SP3 (从 SqlSmoObject 继承。)
公共方法 IsWindowsGroupMember Verifies whether the specified Microsoft Windows user account is a member of the specified Windows group.
公共方法 KillAllProcesses Stops the all processes on the specified database.
公共方法 KillDatabase Deletes the specified database and drops any active connection.
公共方法 KillProcess Stops the specified process.
受保护方法 MarkDropped (从 SqlSmoObject 继承。)
受保护方法 MarkForDropImpl (从 SqlSmoObject 继承。)
受保护方法 MemberwiseClone (从 Object 继承。)
公共方法 PingSqlServerVersion(String) Gets the version number of the instance of SQL Server.
公共方法 PingSqlServerVersion(String, String, String) Get the version number of the specified instance of SQL Server using the specified login and password to gain access.
受保护方法 PostAlter (从 SqlSmoObject 继承。)
受保护方法 PostCreate (从 SqlSmoObject 继承。)
受保护方法 PostDrop (从 SqlSmoObject 继承。)
公共方法 ReadErrorLog() () () () Enumerates the SQL Server error log.
公共方法 ReadErrorLog(Int32) Enumerates the specified SQL Server error log.
公共方法 Refresh Refreshes the objects and properties on the Server object. (覆盖 SqlSmoObject. . :: . .Refresh() () () ()。)
公共方法 Revoke(ServerPermissionSet, String) Revokes a previously granted set of permissions from a list of grantees on the instance of SQL Server.
公共方法 Revoke(ServerPermissionSet, array<String> [] () [] []) Revokes a previously granted set of permissions from a list of grantees on the instance of SQL Server.
公共方法 Revoke(ServerPermissionSet, String, Boolean, Boolean) Revokes previously granted permissions from a grantee on the instance of SQL Server and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.
公共方法 Revoke(ServerPermissionSet, array<String> [] () [] [], Boolean, Boolean) Revokes previously granted permissions from grantees on the instance of SQL Server and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.
公共方法 Revoke(ServerPermissionSet, String, Boolean, Boolean, String) Revokes previously granted permissions from a grantee on the instance of SQL Server and any other users to whom the grantee has granted the specified set of permissions. The grantee is also given the ability to revoke the specified set of permissions from other users under an assumed role.
公共方法 Revoke(ServerPermissionSet, array<String> [] () [] [], Boolean, Boolean, String) Revokes previously granted permissions from grantees on the instance of SQL Server and any other users to whom the grantees have granted the specified set of permissions. The grantees are also given the ability to revoke the specified set of permissions from other users under an assumed role.
公共方法 Script() () () ()
公共方法 Script(ScriptingOptions)
受保护方法 ScriptAlter (从 SqlSmoObject 继承。)
受保护方法 ScriptCreate (从 SqlSmoObject 继承。)
受保护方法 ScriptDdl (从 SqlSmoObject 继承。)
受保护方法 ScriptDrop (从 SqlSmoObject 继承。)
受保护方法 ScriptImpl() () () () (从 SqlSmoObject 继承。)
受保护方法 ScriptImpl(ScriptingOptions) (从 SqlSmoObject 继承。)
受保护方法 ScriptImplWorker (从 SqlSmoObject 继承。)
公共方法 SetDefaultInitFields(Boolean) Specifies that all properties are fetched when objects are instantiated.
公共方法 SetDefaultInitFields(Type, Boolean) Specifies all the properties are fetched when objects of the specified type are instantiated.
公共方法 SetDefaultInitFields(Type, StringCollection) Specifies the properties that are fetched when objects of the specified type are instantiated.
公共方法 SetDefaultInitFields(Type, array<String> [] () [] []) Specifies the properties that are fetched when objects of the specified type are instantiated.
受保护方法 SetParentImpl (从 SqlSmoObject 继承。)
公共方法 SetTraceFlag Sets a trace flag.
公共方法 ToString Returns a String that represents the referenced object. (从 SqlSmoObject 继承。)
受保护方法 TouchImpl (从 SqlSmoObject 继承。)
受保护方法 UnbindDefaultImpl (从 SqlSmoObject 继承。)
受保护方法 UnbindRuleImpl (从 SqlSmoObject 继承。)
公共方法 Validate (从 SmoObjectBase 继承。)

页首

事件

  名称 说明
公共事件 PropertyChanged (从 SqlSmoObject 继承。)
公共事件 PropertyMetadataChanged (从 SqlSmoObject 继承。)

页首

字段

  名称 说明
受保护字段 m_ExtendedProperties (从 SqlSmoObject 继承。)

页首

注释

The Server class represents an instance of SQL Server. In SMO programming, the Server object determines the connection to a physical SQL Server installation. The Server class is the highest level in the SMO instance object hierarchy. When a Server object variable is created, it establishes a connection to an instance of SQL Server. If you do not specify the name in the Server class constructor, the connection is always made with the local, default instance of SQL Server.

By using the Server object, you can do the following:

  • Connect to an instance of SQL Server.

  • Modify the connection settings.

  • Run Transact-SQL statements directly.

  • Capture Transact-SQL output from the SMO program.

  • Manage transactions.

  • View operating system information.

  • Modify and view SQL Server settings, information, and user options.

  • Modify and view SQL Server configuration options.

  • Register the instance of SQL Server in the Active Directory directory service.

  • Subscribe to and handle SQL Server events.

  • Reference databases, endpoints, credentials, logins, linked servers, system messages, DDL triggers, system data types, and user-defined messages.

  • Regenerate the service master key.

  • Detach and attach databases.

  • Stop processes or databases.

  • Grant, deny, or revoke permissions on the database.

  • Enumerate information about the server.

  • Read the error log.

  • Remove the backup history.

  • Get and set the default initialization fields for specified types.

  • Create endpoints, such as database mirroring endpoint.

To get Server object properties, users can be a member of the public fixed server role.

To set Server object properties, users must be a member of the sysadmin fixed server role.

Thread Safety

此类型的任何公共静态(Microsoft Visual Basic 中的 Shared)成员在多线程操作中是安全的。 不保证所有实例成员都对于线程安全的。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。