Classe Server

The Server object represents an instance of SQL Server.

Hiérarchie d'héritage

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

Espace de noms :  Microsoft.SqlServer.Management.Smo
Assembly :  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Syntaxe

'Déclaration
<PhysicalFacetAttribute> _
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
<RootFacetAttribute(GetType(Server))> _
Public NotInheritable Class Server _
    Inherits SqlSmoObject _
    Implements ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings,  _
    IServerInformation, IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection
'Utilisation
Dim instance As Server
[PhysicalFacetAttribute]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
[RootFacetAttribute(typeof(Server))]
public sealed class Server : SqlSmoObject, 
    ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings, IServerInformation, 
    IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection
[PhysicalFacetAttribute]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
[RootFacetAttribute(typeof(Server))]
public ref class Server sealed : public SqlSmoObject, 
    ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings, IServerInformation, 
    IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection
[<SealedAttribute>]
[<PhysicalFacetAttribute>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
[<RootFacetAttribute(typeof(Server))>]
type Server =  
    class 
        inherit SqlSmoObject 
        interface ISfcSupportsDesignMode 
        interface IAlterable 
        interface IScriptable 
        interface IServerSettings 
        interface IServerInformation 
        interface IDmfFacet 
        interface IAlienRoot 
        interface ISfcDomainLite 
        interface ISfcHasConnection 
    end
public final class Server extends SqlSmoObject implements ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings, IServerInformation, IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection

Le type Server expose les membres suivants.

Constructeurs

  Nom Description
Méthode publique Server() Initializes a new instance of the Server class.
Méthode publique Server(String) Initializes a new instance of the Server class with the specified name.
Méthode publique Server(ServerConnection) Initializes a new instance of the Server class based on the specified connection.

Haut de la page

Propriétés

  Nom Description
Propriété publique ActiveDirectory Obsolète. Gets information about the Active Directory settings for the instance of SQL Server.
Propriété publique AffinityInfo Gets the AffinityInfo object that is associated with an instance of SQL Server.
Propriété publique AuditLevel Gets or sets the AuditLevel property value.
Propriété publique Audits Represents a collection of Audit objects. Each Audit object represents an audit log defined on the instance of SQL Server.
Propriété publique AvailabilityGroups Gets the available groups in the server.
Propriété publique BackupDevices Represents a collection of BackupDevice objects. Each BackupDevice object represents a backup device defined on the instance of SQL Server.
Propriété publique BackupDirectory Gets or sets the BackupDirectory property value.
Propriété publique BrowserServiceAccount Gets the service account that the Browser service runs under on the instance of SQL Server.
Propriété publique BrowserStartMode Gets the start mode for the SQL Server Browser Service running on the instance of SQL Server.
Propriété publique BuildClrVersion Gets the BuildClrVersion property value.
Propriété publique BuildClrVersionString Gets the version string of the CLR that was used while building the instance.
Propriété publique BuildNumber Gets the BuildNumber property value.
Propriété publique ClusterName Gets the name of the cluster.
Propriété publique ClusterQuorumState Gets the state of the cluster quorum.
Propriété publique ClusterQuorumType Gets the type of the cluster quorum.
Propriété publique Collation Gets the Collation property value.
Propriété publique CollationID Gets the CollationID property value.
Propriété publique ComparisonStyle Gets the Windows comparison style of the collation.
Propriété publique ComputerNamePhysicalNetBIOS Gets the NetBIOS name of the local computer on which the instance of SQL Server is currently running.
Propriété publique Configuration Gets the configuration options for the instance of SQL Server.
Propriété publique ConnectionContext Gets the current server connection details for the instance of SQL Server.
Propriété publique Credentials Represents a collection of Credential objects. Each Credential object represents a credential defined on the instance of SQL Server.
Propriété publique CryptographicProviders Gets the list of server cryptographic providers.
Propriété publique Databases Represents a collection of Database objects. Each Database object represents a database defined on the instance of SQL Server.
Propriété publique DefaultFile Gets or sets the DefaultFile property value.
Propriété publique DefaultLog Gets or sets the default log of the server.
Propriété publique DefaultTextMode Gets or sets the Boolean property value that specifies whether the default text mode is set for the instance of SQL Server.
Propriété publique Edition Gets the Edition property value.
Propriété publique Endpoints Represents a collection of Endpoint objects. Each Endpoint object represents an endpoint defined on the instance of SQL Server.
Propriété publique EngineEdition Gets the edition of the engine.
Propriété publique ErrorLogPath Gets the ErrorLogPath property value.
Propriété publique Events Gets the server events that are associated with the instance of SQL Server.
Propriété publique FilestreamLevel Gets the level of FILESTREAM access specified on the instance of SQL Server.
Propriété publique FilestreamShareName Gets the Windows share name where FILESTREAM data is stored on the instance of SQL Server.
Propriété publique FullTextService Gets the Microsoft Search Full-Text service implementation for the instance of SQL Server.
Propriété publique HadrManagerStatus Gets the status of the Hadr manager.
Propriété publique Information Gets information about the instance of SQL Server.
Propriété publique InstallDataDirectory Gets the local Windows directory where the installation data is stored for the instance of SQL Server.
Propriété publique InstallSharedDirectory Gets the remote shared directory where the installation data is stored for the instance of SQL Server.
Propriété publique InstanceName Gets the instance name of the instance of SQL Server.
Propriété publique IsCaseSensitive Gets the value that indicates whether the case is sensitive.
Propriété publique IsClustered Gets the IsClustered property value.
Propriété publique IsFullTextInstalled Gets the Boolean value that specifies whether Full-Text service is installed on the instance of SQL Server.
Propriété publique IsHadrEnabled Gets a value that indicates whether the Hadr is enabled.
Propriété publique IsSingleUser Gets the property value whether the user is single.
Propriété publique JobServer Gets the SQL Server Agent associated with the instance of SQL Server.
Propriété publique Language Gets the language of the server.
Propriété publique Languages Represents a collection of Language objects. Each Language object represents an languages supported by the instance of SQL Server.
Propriété publique LinkedServers Represents a collection of LinkedServer objects. Each LinkedServer object represents a linked server registered on the instance of SQL Server.
Propriété publique LoginMode Gets or sets the ServerLoginMode property value.
Propriété publique Logins Represents a collection of Login objects. Each Login object represents a login defined on the instance of SQL Server.
Propriété publique Mail Gets the Microsoft SQL Mail service associated with the instance of SQL Server.
Propriété publique MailProfile Gets or sets the mail profile of the server.
Propriété publique MasterDBLogPath Get the MasterDBLogPath property value.
Propriété publique MasterDBPath Gets the MasterDBPath property value.
Propriété publique MaxPrecision Gets the MaxPrecision property value.
Propriété publique Name Gets the name of the server, which is the physical machine name.
Propriété publique NamedPipesEnabled Gets the Boolean value that specifies whether Named Pipes provider is enabled for client-server connectivity on the instance of SQL Server.
Propriété publique NetName Gets the NetName property value.
Propriété publique NumberOfLogFiles Gets or sets the NumberOfLogFiles property value.
Propriété publique OleDbProviderSettings Gets the DbProviderSettings property value.
Propriété publique OSVersion Gets the OSVersion property value.
Propriété publique PerfMonMode Gets or sets the PerfMonMode property value.
Propriété publique PhysicalMemory Gets the physical memory used by the server.
Propriété publique PhysicalMemoryUsageInKB Gets an Int64 value that specifies the amount of memory in use by the instance of the Database Engine, in kilobytes.
Propriété publique Platform Gets the server platform.
Propriété publique Processors Gets the Processors property value.
Propriété publique ProcessorUsage Gets an Int32 value that specifies the processor time used by the instance of the Database Engine.
Propriété publique Product Gets the product of the server.
Propriété publique ProductLevel Gets the ProductLevel property value.
Propriété publique Properties Gets a collection of Property objects that represent the object properties. (hérité de SqlSmoObject.)
Propriété publique ProxyAccount Gets the proxy account associated with the instance of SQL Server.
Propriété publique ResourceGovernor Gets the resource governor of the server.
Propriété publique ResourceLastUpdateDateTime Gets the last time the resource was last updated.
Propriété publique ResourceVersion Gets the ResourceVersion property.
Propriété publique ResourceVersionString Gets the ResouceVersionString property value.
Propriété publique Roles Represents a collection of ServerRole objects. Each ServerRole object represents a role defined on the instance of SQL Server.
Propriété publique RootDirectory Gets the RootDirectory property value.
Propriété publique ServerAuditSpecifications Represents a collection of ServerAuditSpecification objects. Each ServerAuditSpecification object represents a specific audit specification defined on the instance of SQL Server.
Propriété publique ServerType Gets the server type for the instance of SQL Server.
Propriété publique ServiceAccount Gets the service account under which the instance of SQL Server is running.
Propriété publique ServiceInstanceId Gets the ID value that uniquely identifies the service instance for this instance of SQL Server.
Propriété publique ServiceMasterKey Gets the service master key associated with the instance of SQL Server.
Propriété publique ServiceName Gets the service name for the server.
Propriété publique ServiceStartMode Gets the start mode for the SQL Server service.
Propriété publique Settings Gets modifiable settings for the instance of SQL Server.
Propriété publique SqlCharSet Gets the value that identifies the character set used by the server.
Propriété publique SqlCharSetName Gets the name of the character set used by the server.
Propriété publique SqlDomainGroup Gets the domain group for the instance of SQL Server.
Propriété publique SqlSortOrder Gets the SQL sort order from the collation.
Propriété publique SqlSortOrderName Gets the name of the sort order used by the server.
Propriété publique State Gets the state of the referenced object. (hérité de SmoObjectBase.)
Propriété publique Status Gets the current status of the Server.
Propriété publique SystemDataTypes Represents a collection of SystemDataType objects. Each SystemDataType object represents a system data type defined on the instance of SQL Server.
Propriété publique SystemMessages Represents a collection of SystemMessage objects. Each SystemMessage object represents a system message defined on the instance of SQL Server.
Propriété publique TapeLoadWaitTime Gets or sets the TapeLoadWaitTime property value.
Propriété publique TcpEnabled Gets the Boolean value that determines whether TCP/IP protocol is enabled on this instance of SQL Server.
Propriété publique 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.
Propriété publique Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (hérité de SqlSmoObject.)
Propriété publique UserData Gets or sets user-defined data associated with the referenced object. (hérité de SmoObjectBase.)
Propriété publique UserDefinedMessages Represents a collection of UserDefinedMessage objects. Each UserDefinedMessage object represents a user-defined message defined on the instance of SQL Server.
Propriété publique UserOptions Gets the user options for the current connection to the instance of SQL Server.
Propriété publique Version Gets the Version property value.
Propriété publique VersionMajor Gets the major version of the server.
Propriété publique VersionMinor Gets the VersionMinor property value.
Propriété publique VersionString Gets the version string of the server.

Haut de la page

Méthodes

  Nom Description
Méthode publique Alter() Updates any Server object property changes on the instance of SQL Server. 
Méthode publique Alter(Boolean) Updates any Server object property changes on the instance of SQL Server with the option to override value checking.
Méthode publique 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. 
Méthode publique AttachDatabase(String, StringCollection, AttachOptions) Attaches an existing database that is made up of one or more files to the instance of SQL Server that has the specified name and using the specified data files and attachment options. 
Méthode publique 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. 
Méthode publique AttachDatabase(String, StringCollection, String, AttachOptions) Attaches an existing database that is made up of one or more files to the instance of SQL Server by using the specified name, data files, and attachment options. 
Méthode publique CompareUrn Compares two URNS.
Méthode publique DeleteBackupHistory(DateTime) Deletes the backup history for this instance of SQL Server up until the specified date and time.
Méthode publique DeleteBackupHistory(Int32) Deletes the backup history for the specified media set.
Méthode publique DeleteBackupHistory(String) Deletes the backup history for the specified database.
Méthode publique Deny(ServerPermissionSet, String) Denies the specified set of permissions for the specified grantee on the instance of SQL Server.
Méthode publique Deny(ServerPermissionSet, array<String[]) Denies the specified set of permissions for the specified grantees on the instance of SQL Server.
Méthode publique 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.
Méthode publique 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.
Méthode publique DetachDatabase(String, Boolean) Detaches the specified database from the instance of SQL Server with the option to update statistics before the database is detached.
Méthode publique 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.
Méthode publique DetachedDatabaseInfo Returns information about a detached database file.
Méthode publique Discover Discovers a list of type Object. (hérité de SqlSmoObject.)
Méthode publique EnumActiveCurrentSessionTraceFlags Gets active session flags as a DataTable.
Méthode publique EnumActiveGlobalTraceFlags Gets a DataTable that contains active global trace flags.
Méthode publique EnumAvailableMedia() Enumerates a list of media that is visible to the instance of SQL Server on the local area network.
Méthode publique 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.
Méthode publique EnumClusterMembersState Enumerates the current state of the Windows cluster members of which the instance is part of.
Méthode publique EnumClusterSubnets Enumerates a list of cluster subnets.
Méthode publique EnumCollations Enumerates a list of collations supported by the instance of SQL Server.
Méthode publique EnumDatabaseMirrorWitnessRoles() Enumerates a list of database mirror witness roles.
Méthode publique EnumDatabaseMirrorWitnessRoles(String) Enumerates a list of mirror witness roles for the specified database.
Méthode publique EnumDetachedDatabaseFiles Enumerates a list of detached database files.
Méthode publique EnumDetachedLogFiles Enumerates a list of detached log files.
Méthode publique EnumDirectories Enumerates a list of directories relative to the specified path.
Méthode publique EnumErrorLogs Enumerates a list of SQL Server error log files.
Méthode publique EnumLocks() Enumerates a list of current locks held on the instance of SQL Server.
Méthode publique EnumLocks(Int32) Enumerates a list of current locks held by the specified process on the instance of SQL Server.
Méthode publique EnumMembers Enumerates a list of members of server roles and database roles on the instance of SQL Server.
Méthode publique EnumObjectPermissions() Enumerates a list of object permissions for the instance of SQL Server.
Méthode publique EnumObjectPermissions(String) Enumerates a list of object permissions for a specified grantee on the application instance of SQL Server.
Méthode publique EnumObjectPermissions(ObjectPermissionSet) Enumerates a list of object permissions for a specified permission on the instance of SQL Server.
Méthode publique EnumObjectPermissions(String, ObjectPermissionSet) Enumerates a list of object permissions for a specified grantee and a specified permission on the instance of SQL Server.
Méthode publique EnumPerformanceCounters() Enumerates a list of performance counters that are supported by the instance of SQL Server.
Méthode publique EnumPerformanceCounters(String) Enumerates a list of performance counters that are supported by the instance of SQL Server for a specified object.
Méthode publique 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.
Méthode publique 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.
Méthode publique EnumProcesses() Enumerates a list of processes running on the instance of SQL Server.
Méthode publique EnumProcesses(Boolean) Enumerates a list of processes running on the instance of SQL Server with the option to exclude system processes.
Méthode publique EnumProcesses(Int32) Enumerates a list of information about the specified process.
Méthode publique EnumProcesses(String) Enumerates a list of processes running on the instance of SQL Server that are associated with the specified login.
Méthode publique EnumServerAttributes Enumerates a list of server attributes for the instance of SQL Server.
Méthode publique EnumServerPermissions() Enumerates a list of server permissions for the instance of SQL Server.
Méthode publique EnumServerPermissions(String) Enumerates a list of server permissions for a specified grantee on the instance of SQL Server.
Méthode publique EnumServerPermissions(ServerPermissionSet) Enumerates a list of server permissions for a specified permission on the instance of SQL Server.
Méthode publique EnumServerPermissions(String, ServerPermissionSet) Enumerates a list of server permissions for a specified grantee and a specified permission on the instance of SQL Server.
Méthode publique EnumStartupProcedures Enumerates a list of startup procedures.
Méthode publique EnumWindowsDomainGroups() Enumerates a list of Microsoft Windows group accounts defined on a domain.
Méthode publique EnumWindowsDomainGroups(String) Enumerates a list of Microsoft Windows group accounts defined for the specified domain.
Méthode publique EnumWindowsGroupInfo() Enumerates a list of information about all Microsoft Windows groups that have explicitly granted access to the instance of SQL Server.
Méthode publique EnumWindowsGroupInfo(String) Enumerates a list of information about all Microsoft Windows groups that have explicitly granted access to the instance of SQL Server.
Méthode publique 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.
Méthode publique EnumWindowsUserInfo() Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to SQL Server.
Méthode publique EnumWindowsUserInfo(String) Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to the instance of SQL Server.
Méthode publique 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.
Méthode publique Equals (hérité de Object.)
Méthode protégée FormatSqlVariant Formats an object as SqlVariant type. (hérité de SqlSmoObject.)
Méthode publique GetActiveDBConnectionCount Returns the number of active connections for the specified database.
Méthode protégée GetContextDB Gets the context database that is associated with this object. (hérité de SqlSmoObject.)
Méthode protégée GetDBName Gets the database name that is associated with the object. (hérité de SqlSmoObject.)
Méthode publique GetDefaultInitFields Returns the property types that are initialized by default when the specified object is initialized.
Méthode publique GetHashCode (hérité de Object.)
Méthode publique GetPropertyNames Returns the names of the initialized properties for the specified object type
Méthode protégée GetPropValue Gets a property value of the SqlSmoObject object. (hérité de SqlSmoObject.)
Méthode protégée GetPropValueOptional Gets a property value of the SqlSmoObject object. (hérité de SqlSmoObject.)
Méthode protégée GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (hérité de SqlSmoObject.)
Méthode protégée GetServerObject Gets the server of the SqlSmoObject object. (hérité de SqlSmoObject.)
Méthode publique GetSmoObject Gets a SqlSmoObject that is specified by a URN.
Méthode publique GetStringComparer Returns the comparer object corresponding to the collation string passed.
Méthode publique GetType (hérité de Object.)
Méthode publique Grant(ServerPermissionSet, String) Grants the specified set of permissions to the specified grantee on the instance of SQL Server.
Méthode publique Grant(ServerPermissionSet, array<String[]) Grants the specified set of permissions to the specified grantees on the instance of SQL Server.
Méthode publique 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.
Méthode publique 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.
Méthode publique 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.
Méthode publique 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.
Méthode publique Initialize() Initializes the object and forces the properties be loaded. (hérité de SqlSmoObject.)
Méthode publique Initialize(Boolean) Initializes the object and forces the properties be loaded. (hérité de SqlSmoObject.)
Méthode publique IsDetachedPrimaryFile Verifies whether the specified file is a primary (.mdf) database file.
Méthode protégée IsObjectInitialized Verifies whether the object has been initialized. (hérité de SqlSmoObject.)
Méthode protégée IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (hérité de SqlSmoObject.)
Méthode publique IsWindowsGroupMember Verifies whether the specified Microsoft Windows user account is a member of the specified Windows group.
Méthode publique JoinAvailabilityGroup Indicates a specified object to join the availability group.
Méthode publique KillAllProcesses Stops the all processes on the specified database.
Méthode publique KillDatabase Deletes the specified database and drops any active connection.
Méthode publique KillProcess Stops the specified process.
Méthode publique PingSqlServerVersion(String) Gets the version number of the instance of SQL Server.
Méthode publique PingSqlServerVersion(String, String, String) Get the version number of the specified instance of SQL Server using the specified login and password to gain access.
Méthode publique ReadErrorLog() Enumerates the SQL Server error log.
Méthode publique ReadErrorLog(Int32) Enumerates the specified SQL Server error log.
Méthode publique Refresh Refreshes the objects and properties on the Server object. (remplace SqlSmoObject.Refresh().)
Méthode publique Revoke(ServerPermissionSet, String) Revokes a previously granted set of permissions from a list of grantees on the instance of SQL Server.
Méthode publique Revoke(ServerPermissionSet, array<String[]) Revokes a previously granted set of permissions from a list of grantees on the instance of SQL Server.
Méthode publique 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.
Méthode publique 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.
Méthode publique 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.
Méthode publique 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.
Méthode publique Script() Generates a Transact-SQL script that can be used to re-create the server.
Méthode publique Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the server by using the specified scripting options.
Méthode publique SetDefaultInitFields(Boolean) Specifies that all properties are fetched when objects are instantiated.
Méthode publique SetDefaultInitFields(Type, Boolean) Specifies all the properties are fetched when objects of the specified type are instantiated.
Méthode publique SetDefaultInitFields(Type, StringCollection) Specifies the properties that are fetched when objects of the specified type are instantiated.
Méthode publique SetDefaultInitFields(Type, array<String[]) Specifies the properties that are fetched when objects of the specified type are instantiated.
Méthode protégée SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (hérité de SqlSmoObject.)
Méthode publique SetTraceFlag Sets a trace flag.
Méthode publique ToString Returns a String that represents the referenced object. (hérité de SqlSmoObject.)
Méthode publique Validate Validates the state of an object. (hérité de SmoObjectBase.)

Haut de la page

Événements

  Nom Description
Événement public PropertyChanged Represents the event that occurs when a property is changed. (hérité de SqlSmoObject.)
Événement public PropertyMetadataChanged Represents the event that occurs when property metadata changes. (hérité de SqlSmoObject.)

Haut de la page

Implémentations d'interfaces explicites

  Nom Description
Implémentation d'interface expliciteMéthode privée IAlienObject.Discover Discovers any dependencies. Ne faites pas directement référence à ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.GetDomainRoot Returns the root of the domain. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.GetParent Gets the parent of this object. Ne faites pas directement référence à ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.GetPropertyType Gets the type of the specified property. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.GetPropertyValue Gets the value of the specified property. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. Ne faites pas directement référence à ce membre dans votre code. Il prend en charge l'infrastructure SQL Server. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienObject.SetPropertyValue Sets the property value. (hérité de SqlSmoObject.)
Implémentation d'interface expliciteMéthode privée IAlienRoot.DesignModeInitialize Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Ensures that the Server object is in design mode, that it is disconnected from the instance of the Database Engine it represents.
Implémentation d'interface expliciteMéthode privée IAlienRoot.SfcHelper_GetDataTable Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Gets a DataTable object containing the results from a URN.
Implémentation d'interface expliciteMéthode privée IAlienRoot.SfcHelper_GetSmoObject Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Gets the Object that represents the object identified by a specified URN.
Implémentation d'interface expliciteMéthode privée IAlienRoot.SfcHelper_GetSmoObjectQuery Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Gets a List of String values.
Implémentation d'interface explicitePropriété privée ISfcDomainLite.DomainInstanceName Gets the instance name of the domain.
Implémentation d'interface explicitePropriété privée ISfcDomainLite.DomainName Gets the domain name.
Implémentation d'interface expliciteMéthode privée ISfcDomainLite.GetLogicalVersion Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Gets an Int32 value that indicates whether changes have been made to the Server object.
Implémentation d'interface explicitePropriété privée ISfcHasConnection.ConnectionContext Gets the context for the connection represented by the current Server object.
Implémentation d'interface expliciteMéthode privée ISfcHasConnection.GetConnection() Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Gets a connection to an Sfc backing store.
Implémentation d'interface expliciteMéthode privée ISfcHasConnection.GetConnection(SfcObjectQueryMode) Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Gets a connection to an Sfc backing store that supports the requested query mode.
Implémentation d'interface expliciteMéthode privée ISfcHasConnection.SetConnection Identifié à titre d'information uniquement. Non pris en charge. La compatibilité future n'est pas garantie. Sets a connection to an Sfc backing store.
Implémentation d'interface expliciteMéthode privée ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (hérité de SqlSmoObject.)
Implémentation d'interface explicitePropriété privée ISfcSupportsDesignMode.IsDesignMode Gets a Boolean value that specifies whether the Server supports design mode.

Haut de la page

Notes

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

Tout membre statique public (Partagé dans Microsoft Visual Basic) de ce type est sûr dans le cadre des opérations à plusieurs threads. Tous les membres de l'instance ne sont pas garantis comme étant thread-safe.

Exemples

Connexion à une instance de SQL Server

Sécurité des threads

Tous les membres publics static (Shared dans Visual Basic) de ce type sont thread-safe. Tous les membres de l'instance ne sont pas garantis comme étant thread-safe.

Voir aussi

Référence

Espace de noms Microsoft.SqlServer.Management.Smo

Autres ressources

Connexion à une instance de SQL Server

Déconnexion d'une instance de SQL Server