Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

Server Class

The Server object represents an instance of SQL Server.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
[<SealedAttribute>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
[<PhysicalFacetAttribute>]
[<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

The Server type exposes the following members.

  NameDescription
Public methodServer()Initializes a new instance of the Server class.
Public methodServer(String)Initializes a new instance of the Server class with the specified name.
Public methodServer(ServerConnection)Initializes a new instance of the Server class based on the specified connection.
Top
  NameDescription
Public propertyActiveDirectoryGets information about the Active Directory settings for the instance of SQL Server.
Public propertyAffinityInfoGets the AffinityInfo object that is associated with an instance of SQL Server.
Public propertyAuditLevelGets or sets the AuditLevel property value.
Public propertyAuditsRepresents a collection of Audit objects. Each Audit object represents an audit log defined on the instance of SQL Server.
Public propertyBackupDevicesRepresents a collection of BackupDevice objects. Each BackupDevice object represents a backup device defined on the instance of SQL Server.
Public propertyBackupDirectoryGets or sets the BackupDirectory property value.
Public propertyBrowserServiceAccountGets the service account that the Browser service runs under on the instance of SQL Server.
Public propertyBrowserStartModeGets the start mode for the SQL Server Browser Service running on the instance of SQL Server.
Public propertyBuildClrVersionGets the BuildClrVersion property value.
Public propertyBuildClrVersionStringGets the BuildClrVersionString property value.
Public propertyBuildNumberGets the BuildNumber property value.
Public propertyCollationGets the Collation property value.
Public propertyCollationIDGets the CollationID property value.
Public propertyComparisonStyleGets the ComparisonStyle property value.
Public propertyComputerNamePhysicalNetBIOSGets the ComputerNamePhysicalNetBIOS property value.
Public propertyConfigurationGets the configuration options for the instance of SQL Server.
Public propertyConnectionContextGets the current server connection details for the instance of SQL Server.
Public propertyCredentialsRepresents a collection of Credential objects. Each Credential object represents a credential defined on the instance of SQL Server.
Public propertyCryptographicProvidersGets the CryptographicProviders property value.
Public propertyDatabasesRepresents a collection of Database objects. Each Database object represents a database defined on the instance of SQL Server.
Public propertyDefaultFileGets or sets the DefaultFile property value.
Public propertyDefaultLogGets or sets the DefaultLog property value.
Public propertyDefaultTextModeGets or sets the Boolean property value that specifies whether the default text mode is set for the instance of SQL Server.
Public propertyEditionGets the Edition property value.
Public propertyEndpointsRepresents a collection of Endpoint objects. Each Endpoint object represents an endpoint defined on the instance of SQL Server.
Public propertyEngineEditionGets the EngineEdition property value.
Public propertyErrorLogPathGets the ErrorLogPath property value.
Public propertyEventsGets the server events that are associated with the instance of SQL Server.
Protected propertyExecuteForScalarGets or sets the Boolean property value that specifies whether the object is set to the execute for scalar option. (Inherited from SqlSmoObject.)
Public propertyFilestreamLevelGets the level of FILESTREAM access specified on the instance of SQL Server.
Public propertyFilestreamShareNameGets the Windows share name where FILESTREAM data is stored on the instance of SQL Server.
Public propertyFullTextServiceGets the Microsoft Search Full-Text service implementation for the instance of SQL Server.
Public propertyInformationGets information about the instance of SQL Server.
Public propertyInstallDataDirectoryGets the local Windows directory where the installation data is stored for the instance of SQL Server.
Public propertyInstallSharedDirectoryGets the remote shared directory where the installation data is stored for the instance of SQL Server.
Public propertyInstanceNameGets the instance name of the instance of SQL Server. 
Public propertyIsCaseSensitiveGets the IsCaseSensitive property value.
Public propertyIsClusteredGets the IsClustered property value.
Public propertyIsFullTextInstalledGets the Boolean value that specifies whether Full-Text service is installed on the instance of SQL Server.
Public propertyIsSingleUserGets the IsSingleUser property value.
Protected propertyIsTouchedGets the Boolean property value that specifies whether the object properties have been updated but not yet persisted on the server. (Inherited from SqlSmoObject.)
Public propertyJobServerGets the SQL Server Agent associated with the instance of SQL Server.
Public propertyLanguageGets the Language property value.
Public propertyLanguagesRepresents a collection of Language objects. Each Language object represents an languages supported by the instance of SQL Server.
Public propertyLinkedServersRepresents a collection of LinkedServer objects. Each LinkedServer object represents a linked server registered on the instance of SQL Server.
Public propertyLoginModeGets or sets the ServerLoginMode property value.
Public propertyLoginsRepresents a collection of Login objects. Each Login object represents a login defined on the instance of SQL Server.
Public propertyMailGets the Microsoft SQL Mail service associated with the instance of SQL Server.
Public propertyMailProfileGets or sets the MailProfile property value.
Public propertyMasterDBLogPathGet the MasterDBLogPath property value.
Public propertyMasterDBPathGets the MasterDBPath property value.
Public propertyMaxPrecisionGets the MaxPrecision property value.
Public propertyNameGets the name of the server, which is the physical machine name.
Public propertyNamedPipesEnabledGets the Boolean value that specifies whether Named Pipes provider is enabled for client-server connectivity on the instance of SQL Server.
Public propertyNetNameGets the NetName property value.
Public propertyNumberOfLogFilesGets or sets the NumberOfLogFiles property value.
Protected propertyObjectInSpaceGets 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. (Inherited from SqlSmoObject.)
Public propertyOleDbProviderSettingsGets the DbProviderSettings property value.
Public propertyOSVersionGets the OSVersion property value.
Public propertyPerfMonModeGets or sets the PerfMonMode property value.
Public propertyPhysicalMemoryGets the PhysicalMemory property value.
Public propertyPhysicalMemoryUsageInKBGets an Int64 value that specifies the amount of memory in use by the instance of the Database Engine, in kilobytes.
Public propertyPlatformGets the Platform property value.
Public propertyProcessorsGets the Processors property value.
Public propertyProcessorUsageGets an Int32 value that specifies the processor time used by the instance of the Database Engine.
Public propertyProductGets the Product property value.
Public propertyProductLevelGets the ProductLevel property value.
Public propertyPropertiesGets a collection of Property objects that represent the object properties. (Inherited from SqlSmoObject.)
Public propertyProxyAccountGets the proxy account associated with the instance of SQL Server.
Public propertyResourceGovernorGets the ResourceGovernor property value.
Public propertyResourceLastUpdateDateTimeGets the ResourceLastUpdateDateTime property value.
Public propertyResourceVersionGets the ResourceVersion property.
Public propertyResourceVersionStringGets the ResouceVersionString property value.
Public propertyRolesRepresents a collection of ServerRole objects. Each ServerRole object represents a role defined on the instance of SQL Server.
Public propertyRootDirectoryGets the RootDirectory property value.
Protected propertyScalarResultGets the scalar result for the referenced object. (Inherited from SqlSmoObject.)
Public propertyServerAuditSpecificationsRepresents a collection of ServerAuditSpecification objects. Each ServerAuditSpecification object represents a specific audit specification defined on the instance of SQL Server.
Public propertyServerTypeGets the server type for the instance of SQL Server.
Public propertyServiceAccountGets the service account under which the instance of SQL Server is running.
Public propertyServiceInstanceIdGets the ID value that uniquely identifies the service instance for this instance of SQL Server.
Public propertyServiceMasterKeyGets the service master key associated with the instance of SQL Server.
Public propertyServiceNameGets the service name for the server.
Public propertyServiceStartModeGets the start mode for the SQL Server service.
Public propertySettingsGets modifiable settings for the instance of SQL Server.
Public propertySqlCharSetGets the SqlCharSet property value.
Public propertySqlCharSetNameGets the SqlCharSetName property value.
Public propertySqlDomainGroupGets the domain group for the instance of SQL Server.
Public propertySqlSortOrderGets the SqlSortOrder property value.
Public propertySqlSortOrderNameGets the SqlSortOrderName property value.
Public propertyStateGets the state of the referenced object. (Inherited from SmoObjectBase.)
Public propertyStatusGets the current status of the Server.
Public propertySystemDataTypesRepresents a collection of SystemDataType objects. Each SystemDataType object represents a system data type defined on the instance of SQL Server.
Public propertySystemMessagesRepresents a collection of SystemMessage objects. Each SystemMessage object represents a system message defined on the instance of SQL Server.
Public propertyTapeLoadWaitTimeGets or sets the TapeLoadWaitTime property value.
Public propertyTcpEnabledGets the Boolean value that determines whether TCP/IP protocol is enabled on this instance of SQL Server.
Public propertyTriggersRepresents 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.
Public propertyUrnGets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Inherited from SqlSmoObject.)
Public propertyUserDataGets or sets user-defined data associated with the referenced object. (Inherited from SmoObjectBase.)
Public propertyUserDefinedMessagesRepresents a collection of UserDefinedMessage objects. Each UserDefinedMessage object represents a user-defined message defined on the instance of SQL Server.
Public propertyUserOptionsGets the user options for the current connection to the instance of SQL Server.
Public propertyVersionGets the Version property value.
Public propertyVersionMajorGets the VersionMajor property value.
Public propertyVersionMinorGets the VersionMinor property value.
Public propertyVersionStringGets the VersionString property value.
Top
  NameDescription
Protected methodAddDatabaseContext(StringCollection)Add the database context to the collection of queries identified by the queries parameter. (Inherited from SqlSmoObject.)
Protected methodAddDatabaseContext(StringCollection, ScriptingOptions)Add the database context to the collection of queries identified by the queries parameter, and using the specified scripting options. (Inherited from SqlSmoObject.)
Public methodAlter()Updates any Server object property changes on the instance of SQL Server. 
Public methodAlter(Boolean)Updates any Server object property changes on the instance of SQL Server with the option to override value checking.
Protected methodAlterImplActivates the object altered event. (Inherited from SqlSmoObject.)
Protected methodAlterImplFinishMethod called when object altered event finishes. (Inherited from SqlSmoObject.)
Protected methodAlterImplInitMethod called when object-altered event is intialized. (Inherited from SqlSmoObject.)
Protected methodAlterImplWorkerCalls the Alter methods. (Inherited from SqlSmoObject.)
Public methodAttachDatabase(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. 
Public methodAttachDatabase(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. 
Public methodAttachDatabase(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. 
Public methodAttachDatabase(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. 
Protected methodBindDefaultImplBinds the default items identified by the parameters. (Inherited from SqlSmoObject.)
Protected methodBindRuleImplBinds the rule schema to the rule and columns identified by the parameters. (Inherited from SqlSmoObject.)
Protected methodCheckCollationChecks the order of the scripting options by the collation method identified by the collationName parameter. (Inherited from SqlSmoObject.)
Protected methodCheckObjectState()Validates the state of the referenced object. (Inherited from SqlSmoObject.)
Protected methodCheckObjectState(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. (Inherited from SqlSmoObject.)
Protected methodCheckObjectStateImplChecks the state of a SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodCheckVersion100Checks whether version of SQL Server is SQL Server 2008. (Inherited from SqlSmoObject.)
Protected methodCheckVersion80Checks the validity of the object on SQL Server 2000. (Inherited from SqlSmoObject.)
Protected methodCheckVersion80SP3Checks the validity of the object on SQL Server 2000 SP3. (Inherited from SqlSmoObject.)
Protected methodCheckVersion90Check the validity of the object on SQL Server 2005. (Inherited from SqlSmoObject.)
Protected methodCheckVersionBelow90Checks whether version of SQL Server is before SQL Server 2005. (Inherited from SqlSmoObject.)
Protected methodCleanObjectSets the object to unmodified state. (Inherited from SqlSmoObject.)
Public methodCompareUrnCompares two URNS.
Protected methodCreateImplCreates an object with scripting options. (Inherited from SqlSmoObject.)
Protected methodCreateImplFinishMethod called when the create event finishes. (Inherited from SqlSmoObject.)
Protected methodCreateImplInitMethod called when the create event initializes. (Inherited from SqlSmoObject.)
Public methodDeleteBackupHistory(DateTime)Deletes the backup history for this instance of SQL Server up until the specified date and time.
Public methodDeleteBackupHistory(Int32)Deletes the backup history for the specified media set.
Public methodDeleteBackupHistory(String)Deletes the backup history for the specified database.
Public methodDeny(ServerPermissionSet, String)Denies the specified set of permissions for the specified grantee on the instance of SQL Server.
Public methodDeny(ServerPermissionSet, String[])Denies the specified set of permissions for the specified grantees on the instance of SQL Server.
Public methodDeny(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.
Public methodDeny(ServerPermissionSet, 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.
Public methodDetachDatabase(String, Boolean)Detaches the specified database from the instance of SQL Server with the option to update statistics before the database is detached.
Public methodDetachDatabase(String, Boolean, Boolean)Detaches the specified database from the instance of SQL Server with the option to update statistics before the database is detached.
Public methodDetachedDatabaseInfoReturns information about a detached database file.
Public methodDiscoverDiscovers a list of type Object. (Inherited from SqlSmoObject.)
Protected methodDropImplDrops a SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodDropImplWorkerCalls the drop methods. (Inherited from SqlSmoObject.)
Public methodEnumActiveCurrentSessionTraceFlagsGets active session flags as a DataTable.
Public methodEnumActiveGlobalTraceFlagsGets a DataTable that contains active global trace flags.
Public methodEnumAvailableMedia()Enumerates a list of media that is visible to the instance of SQL Server on the local area network.
Public methodEnumAvailableMedia(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.
Public methodEnumCollationsEnumerates a list of collations supported by the instance of SQL Server.
Public methodEnumDatabaseMirrorWitnessRoles()Enumerates a list of database mirror witness roles.
Public methodEnumDatabaseMirrorWitnessRoles(String)Enumerates a list of mirror witness roles for the specified database.
Public methodEnumDetachedDatabaseFilesEnumerates a list of detached database files.
Public methodEnumDetachedLogFilesEnumerates a list of detached log files.
Public methodEnumDirectoriesEnumerates a list of directories relative to the specified path.
Public methodEnumErrorLogsEnumerates a list of SQL Server error log files.
Public methodEnumLocks()Enumerates a list of current locks held on the instance of SQL Server.
Public methodEnumLocks(Int32)Enumerates a list of current locks held by the specified process on the instance of SQL Server.
Public methodEnumMembersEnumerates a list of members of server roles and database roles on the instance of SQL Server.
Public methodEnumObjectPermissions()Enumerates a list of object permissions for the instance of SQL Server.
Public methodEnumObjectPermissions(String)Enumerates a list of object permissions for a specified grantee on the application instance of SQL Server.
Public methodEnumObjectPermissions(ObjectPermissionSet)Enumerates a list of object permissions for a specified permission on the instance of SQL Server.
Public methodEnumObjectPermissions(String, ObjectPermissionSet)Enumerates a list of object permissions for a specified grantee and a specified permission on the instance of SQL Server.
Public methodEnumPerformanceCounters()Enumerates a list of performance counters that are supported by the instance of SQL Server.
Public methodEnumPerformanceCounters(String)Enumerates a list of performance counters that are supported by the instance of SQL Server for a specified object.
Public methodEnumPerformanceCounters(String, String)Enumerates a list of performance counters that are supported by the instance of SQL Server for a specified object and specified counter.
Public methodEnumPerformanceCounters(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.
Public methodEnumProcesses()Enumerates a list of processes running on the instance of SQL Server.
Public methodEnumProcesses(Boolean)Enumerates a list of processes running on the instance of SQL Server with the option to exclude system processes.
Public methodEnumProcesses(Int32)Enumerates a list of information about the specified process.
Public methodEnumProcesses(String)Enumerates a list of processes running on the instance of SQL Server that are associated with the specified login.
Protected methodEnumScriptImplEnumerates scripts specified by the so parameter. (Inherited from SqlSmoObject.)
Protected methodEnumScriptImplWorkerCalls the methods that enumerate scripts specified by the so parameter. (Inherited from SqlSmoObject.)
Protected methodEnumScriptImplWorkerSOChangedReturns an IEnumerable string describing the scripting options for an object. (Inherited from SqlSmoObject.)
Public methodEnumServerAttributesEnumerates a list of server attributes for the instance of SQL Server.
Public methodEnumServerPermissions()Enumerates a list of server permissions for the instance of SQL Server.
Public methodEnumServerPermissions(String)Enumerates a list of server permissions for a specified grantee on the instance of SQL Server.
Public methodEnumServerPermissions(ServerPermissionSet)Enumerates a list of server permissions for a specified permission on the instance of SQL Server.
Public methodEnumServerPermissions(String, ServerPermissionSet)Enumerates a list of server permissions for a specified grantee and a specified permission on the instance of SQL Server.
Public methodEnumStartupProceduresEnumerates a list of startup procedures.
Public methodEnumWindowsDomainGroups()Enumerates a list of Microsoft Windows group accounts defined on a domain.
Public methodEnumWindowsDomainGroups(String)Enumerates a list of Microsoft Windows group accounts defined for the specified domain.
Public methodEnumWindowsGroupInfo()Enumerates a list of information about all Microsoft Windows groups that have explicitly granted access to the instance of SQL Server.
Public methodEnumWindowsGroupInfo(String)Enumerates a list of information about all Microsoft Windows groups that have explicitly granted access to the instance of SQL Server.
Public methodEnumWindowsGroupInfo(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.
Public methodEnumWindowsUserInfo()Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to SQL Server.
Public methodEnumWindowsUserInfo(String)Enumerates a list of information about all Microsoft Windows users that have explicitly granted access to the instance of SQL Server.
Public methodEnumWindowsUserInfo(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.
Public methodEquals (Inherited from Object.)
Protected methodExecuteNonQueryExecutes a batch in the context of the database where there are no results returned. (Inherited from SqlSmoObject.)
Protected methodFinalize (Inherited from Object.)
Protected methodFormatSqlVariantFormats an object as SqlVariant type. (Inherited from SqlSmoObject.)
Protected methodGenerateDataSpaceFileStreamScriptGenerates a script to create data file. (Inherited from SqlSmoObject.)
Protected methodGenerateDataSpaceScriptGenerates a script to allocate space in the data file. (Inherited from SqlSmoObject.)
Public methodGetActiveDBConnectionCountReturns the number of active connections for the specified database.
Protected methodGetBindDefaultScriptGets the script that binds defaults specified by the defSchema and defName parameters. (Inherited from SqlSmoObject.)
Protected methodGetBindRuleScriptGets the script that specifies the binding rules. (Inherited from SqlSmoObject.)
Protected methodGetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32)Assigns a Boolean parameter of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodGetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean)Assigns a Boolean property of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodGetDateTimeParameterAssigns the datetime property of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodGetDateTimeParameterAsIntAssigns the datetime property of the SqlSmoObject as an integer value if the datetime property is not null. (Inherited from SqlSmoObject.)
Protected methodGetDBNameGets the database name that is associated with the object. (Inherited from SqlSmoObject.)
Public methodGetDefaultInitFieldsReturns the property types that are initialized by default when the specified object is initialized.
Protected methodGetEnumParameterAssigns an enumeration property of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodGetFragOptionStringGets a FragmentationOption object as a string value. (Inherited from SqlSmoObject.)
Protected methodGetGuidParameterAssigns a Guid property of the SqlSmoObject. (Inherited from SqlSmoObject.)
Public methodGetHashCode (Inherited from Object.)
Protected methodGetParameter(StringBuilder, ScriptingOptions, String, String, Int32)Assigns a parameter of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodGetParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean)Assigns a parameter of the SqlSmoObject. (Inherited from SqlSmoObject.)
Public methodGetPropertyNamesReturns the names of the initialized properties for the specified object type
Protected methodGetPropValueGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetPropValueOptionalGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetPropValueOptionalAllowNullGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetRealValueGets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetScriptingOptionsForCreateGets ScriptingOptions for the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetServerNameGets the name of the instance of SQL Server with which the object is associated. (Inherited from SqlSmoObject.)
Protected methodGetServerObjectGets the server of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Public methodGetSmoObjectGets a SqlSmoObject that is specified by a URN.
Protected methodGetSqlServerVersionNameGets the version name of the instance of SQL Server with which the object is associated. (Inherited from SqlSmoObject.)
Public methodGetStringComparerGets an IComparer interface.
Protected methodGetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32)Assigns a string parameter of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32, Boolean)Assigns a string parameter of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetTimeSpanParameterAsIntAssigns a time span parameter of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Public methodGetType (Inherited from Object.)
Protected methodGetUrnRecursive(StringBuilder)Assigns an Urn object of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Protected methodGetUrnRecursive(StringBuilder, UrnIdOption)Assigns an Urn object of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Public methodGrant(ServerPermissionSet, String)Grants the specified set of permissions to the specified grantee on the instance of SQL Server.
Public methodGrant(ServerPermissionSet, String[])Grants the specified set of permissions to the specified grantees on the instance of SQL Server.
Public methodGrant(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.
Public methodGrant(ServerPermissionSet, 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.
Public methodGrant(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.
Public methodGrant(ServerPermissionSet, 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.
Protected methodImplInitializeInitializes the fields of the SqlSmoObject object. (Inherited from SqlSmoObject.)
Public methodInitialize()Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Public methodInitialize(Boolean)Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.)
Public methodIsDetachedPrimaryFileVerifies whether the specified file is a primary (.mdf) database file.
Protected methodIsObjectDirtyVerifies whether the object properties have been modified and the changes have not yet been persisted on the instance of SQL Server. (Inherited from SqlSmoObject.)
Protected methodIsObjectInitializedVerifies whether the object has been initialized. (Inherited from SqlSmoObject.)
Protected methodIsObjectInSpaceVerifies whether the object is isolated or connected to the instance of SQL Server. (Inherited from SqlSmoObject.)
Protected methodIsVersion80SP3Determines whether the version of SQL Server is SQL Server 2000 with SP3. (Inherited from SqlSmoObject.)
Protected methodIsVersion90AndAboveDetermines whether the version of SQL Server is SQL Server 2005 or later. (Inherited from SqlSmoObject.)
Public methodIsWindowsGroupMemberVerifies whether the specified Microsoft Windows user account is a member of the specified Windows group.
Public methodKillAllProcessesStops the all processes on the specified database.
Public methodKillDatabaseDeletes the specified database and drops any active connection.
Public methodKillProcessStops the specified process.
Protected methodMarkDroppedSets the SqlSmoState to dropped. (Inherited from SqlSmoObject.)
Protected methodMarkForDropImplSets the SqlSmoState to dropped. (Inherited from SqlSmoObject.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodPingSqlServerVersion(String)Gets the version number of the instance of SQL Server.
Public methodPingSqlServerVersion(String, String, String)Get the version number of the specified instance of SQL Server using the specified login and password to gain access.
Protected methodPostAlterMethod activated after the SqlSmoObject is altered. (Inherited from SqlSmoObject.)
Protected methodPostCreateMethod activated after the SqlSmoObject is created. (Inherited from SqlSmoObject.)
Protected methodPostDropMethod activated after the SqlSmoObject is dropped. (Inherited from SqlSmoObject.)
Public methodReadErrorLog()Enumerates the SQL Server error log.
Public methodReadErrorLog(Int32)Enumerates the specified SQL Server error log.
Public methodRefreshRefreshes the objects and properties on the Server object. (Overrides SqlSmoObject.Refresh().)
Public methodRevoke(ServerPermissionSet, String)Revokes a previously granted set of permissions from a list of grantees on the instance of SQL Server.
Public methodRevoke(ServerPermissionSet, String[])Revokes a previously granted set of permissions from a list of grantees on the instance of SQL Server.
Public methodRevoke(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.
Public methodRevoke(ServerPermissionSet, 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.
Public methodRevoke(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.
Public methodRevoke(ServerPermissionSet, 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.
Public methodScript()Generates a Transact-SQL script that can be used to re-create the server.
Public methodScript(ScriptingOptions)Generates a Transact-SQL script that can be used to re-create the server by using the specified scripting options.
Protected methodScriptAlterAlters the SqlSmoObject according to the parameters. (Inherited from SqlSmoObject.)
Protected methodScriptCreateAlters the SqlSmoObject according to the parameters. (Inherited from SqlSmoObject.)
Protected methodScriptDdlThrows InvalidSmoOperationException. (Inherited from SqlSmoObject.)
Protected methodScriptDropThrows InvalidSmoOperationException. (Inherited from SqlSmoObject.)
Protected methodScriptImpl()Gets a collection of scripts of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodScriptImpl(ScriptingOptions)Gets a collection of scripts of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodScriptImplWorkerGets a collection of scripts of the SqlSmoObject. (Inherited from SqlSmoObject.)
Public methodSetDefaultInitFields(Boolean)Specifies that all properties are fetched when objects are instantiated.
Public methodSetDefaultInitFields(Type, Boolean)Specifies all the properties are fetched when objects of the specified type are instantiated.
Public methodSetDefaultInitFields(Type, StringCollection)Specifies the properties that are fetched when objects of the specified type are instantiated.
Public methodSetDefaultInitFields(Type, String[])Specifies the properties that are fetched when objects of the specified type are instantiated.
Protected methodSetParentImplSets the parent of the SqlSmoObject to the newParent parameter. (Inherited from SqlSmoObject.)
Public methodSetTraceFlagSets a trace flag.
Public methodToStringReturns a String that represents the referenced object. (Inherited from SqlSmoObject.)
Protected methodTouchImplNot implemented. (Inherited from SqlSmoObject.)
Protected methodUnbindDefaultImplUnbinds the default columns of the SqlSmoObject. (Inherited from SqlSmoObject.)
Protected methodUnbindRuleImplUnbinds rules of the SqlSmoObject. (Inherited from SqlSmoObject.)
Public methodValidateValidates the state of an object. (Inherited from SmoObjectBase.)
Top
  NameDescription
Public eventPropertyChangedRepresents the event that occurs when a property is changed. (Inherited from SqlSmoObject.)
Public eventPropertyMetadataChangedRepresents the event that occurs when property metadata changes. (Inherited from SqlSmoObject.)
Top
  NameDescription
Protected fieldm_ExtendedPropertiesRepresents a property that is defined to extend the properties provided by a SqlSmoObject. (Inherited from SqlSmoObject.)
Protected fieldsingletonParentRepresents the singleton parent. (Inherited from SqlSmoObject.)
Top
  NameDescription
Explicit interface implemetationPrivate methodIAlienObject.DiscoverDiscovers any dependencies. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetDomainRootReturns the root of the domain. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetParentGets the parent of this object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetPropertyTypeGets the type of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetPropertyValueGets the value of the specified property. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.GetUrnGets the Unified Resource Name of the object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.ResolveGets the instance that contains the information about the object from the Unified Resource Name of the object. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.SetObjectStateSets the object state to the specified SfcObjectState value. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienObject.SetPropertyValueSets the property value. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate methodIAlienRoot.DesignModeInitializeIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed. Ensures that the Server object is in design mode, that it is disconnected from the instance of the Database Engine it represents.
Explicit interface implemetationPrivate methodIAlienRoot.SfcHelper_GetDataTableIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets a DataTable object containing the results from a URN.
Explicit interface implemetationPrivate methodIAlienRoot.SfcHelper_GetSmoObjectIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets the Object that represents the object identified by a specified URN.
Explicit interface implemetationPrivate methodIAlienRoot.SfcHelper_GetSmoObjectQueryIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets a List of String values.
Explicit interface implemetationPrivate propertyISfcDomainLite.DomainInstanceNameGets the instance name of the domain.
Explicit interface implemetationPrivate propertyISfcDomainLite.DomainNameGets the domain name.
Explicit interface implemetationPrivate methodISfcDomainLite.GetLogicalVersionIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets an Int32 value that indicates whether changes have been made to the Server object.
Explicit interface implemetationPrivate propertyISfcHasConnection.ConnectionContextGets the context for the connection represented by the current Server object.
Explicit interface implemetationPrivate methodISfcHasConnection.GetConnection()Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets a connection to an Sfc backing store.
Explicit interface implemetationPrivate methodISfcHasConnection.GetConnection(SfcObjectQueryMode)Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets a connection to an Sfc backing store that supports the requested query mode.
Explicit interface implemetationPrivate methodISfcHasConnection.SetConnectionIdentified for informational purposes only. Not supported. Future compatibility is not guaranteed. Sets a connection to an Sfc backing store.
Explicit interface implemetationPrivate methodISfcPropertyProvider.GetPropertySetGets the interface reference to the set of properties of this object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.)
Explicit interface implemetationPrivate propertyISfcSupportsDesignMode.IsDesignModeGets a Boolean value that specifies whether the Server supports design mode.
Top

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

Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.