Server Class
The Server object represents an instance of SQL Server.
Inheritance Hierarchy
System.Object
Microsoft.SqlServer.Management.Smo.SmoObjectBase
Microsoft.SqlServer.Management.Smo.SqlSmoObject
Microsoft.SqlServer.Management.Smo.Server
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
Syntax
'Declaration
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
<PhysicalFacetAttribute> _
<RootFacetAttribute(GetType(Server))> _
Public NotInheritable Class Server _
Inherits SqlSmoObject _
Implements ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings, _
IServerInformation, IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection
'Usage
Dim instance As Server
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
[PhysicalFacetAttribute]
[RootFacetAttribute(typeof(Server))]
public sealed class Server : SqlSmoObject,
ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings, IServerInformation,
IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
[PhysicalFacetAttribute]
[RootFacetAttribute(typeof(Server))]
public ref class Server sealed : public SqlSmoObject,
ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings, IServerInformation,
IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection
[<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
public final class Server extends SqlSmoObject implements ISfcSupportsDesignMode, IAlterable, IScriptable, IServerSettings, IServerInformation, IDmfFacet, IAlienRoot, ISfcDomainLite, ISfcHasConnection
The Server type exposes the following members.
Constructors
Name | Description | |
---|---|---|
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. |
Top
Properties
Name | Description | |
---|---|---|
ActiveDirectory | Gets information about the Active Directory settings for the instance of SQL Server. | |
AffinityInfo | Gets the AffinityInfo object that is associated with an 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. (Inherited from SqlSmoObject.) | |
FilestreamLevel | Gets the level of FILESTREAM access specified on the instance of SQL Server. | |
FilestreamShareName | Gets the Windows share name where FILESTREAM data is stored on the instance of SQL Server. | |
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 | Gets the Boolean value that specifies whether Full-Text service is installed on the instance of SQL Server. | |
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. (Inherited from 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. | |
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. (Inherited from 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. | |
PhysicalMemoryUsageInKB | Gets an Int64 value that specifies the amount of memory in use by the instance of the Database Engine, in kilobytes. | |
Platform | Gets the Platform property value. | |
Processors | Gets the Processors property value. | |
ProcessorUsage | Gets an Int32 value that specifies the processor time used by the instance of the Database Engine. | |
Product | Gets the Product property value. | |
ProductLevel | Gets the ProductLevel property value. | |
Properties | Gets a collection of Property objects that represent the object properties. (Inherited from 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. (Inherited from SqlSmoObject.) | |
ServerAuditSpecifications | Represents a collection of ServerAuditSpecification objects. Each ServerAuditSpecification object represents a specific audit specification defined on the instance of SQL Server. | |
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 | Gets the service name for the server. | |
ServiceStartMode | Gets the start mode for the SQL Server service. | |
Settings | Gets modifiable settings for the instance of SQL Server. | |
SqlCharSet | Gets the SqlCharSet property value. | |
SqlCharSetName | Gets the SqlCharSetName property value. | |
SqlDomainGroup | Gets the domain group for the instance of SQL Server. | |
SqlSortOrder | Gets the SqlSortOrder property value. | |
SqlSortOrderName | Gets the SqlSortOrderName property value. | |
State | Gets the state of the referenced object. (Inherited from SmoObjectBase.) | |
Status | Gets the current status of the Server. | |
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 | Gets the Boolean value that determines whether TCP/IP protocol is enabled on this instance of SQL Server. | |
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. (Inherited from SqlSmoObject.) | |
UserData | Gets or sets user-defined data associated with the referenced object. (Inherited from 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. |
Top
Methods
Name | Description | |
---|---|---|
AddDatabaseContext(StringCollection) | Add the database context to the collection of queries identified by the queries parameter. (Inherited from SqlSmoObject.) | |
AddDatabaseContext(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.) | |
Alter() | Updates any Server object property changes on the instance of SQL Server. | |
Alter(Boolean) | Updates any Server object property changes on the instance of SQL Server with the option to override value checking. | |
AlterImpl | Activates the object altered event. (Inherited from SqlSmoObject.) | |
AlterImplFinish | Method called when object altered event finishes. (Inherited from SqlSmoObject.) | |
AlterImplInit | Method called when object-altered event is intialized. (Inherited from SqlSmoObject.) | |
AlterImplWorker | Calls the Alter methods. (Inherited from 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) | 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. | |
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) | 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. | |
BindDefaultImpl | Binds the default items identified by the parameters. (Inherited from SqlSmoObject.) | |
BindRuleImpl | Binds the rule schema to the rule and columns identified by the parameters. (Inherited from SqlSmoObject.) | |
CheckCollation | Checks the order of the scripting options by the collation method identified by the collationName parameter. (Inherited from SqlSmoObject.) | |
CheckObjectState() | Validates the state of the referenced object. (Inherited from 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. (Inherited from SqlSmoObject.) | |
CheckObjectStateImpl | Checks the state of a SqlSmoObject. (Inherited from SqlSmoObject.) | |
CheckVersion100 | Checks whether version of SQL Server is SQL Server 2008. (Inherited from SqlSmoObject.) | |
CheckVersion80 | Checks the validity of the object on SQL Server 2000. (Inherited from SqlSmoObject.) | |
CheckVersion80SP3 | Checks the validity of the object on SQL Server 2000 SP3. (Inherited from SqlSmoObject.) | |
CheckVersion90 | Check the validity of the object on SQL Server 2005. (Inherited from SqlSmoObject.) | |
CheckVersionBelow90 | Checks whether version of SQL Server is before SQL Server 2005. (Inherited from SqlSmoObject.) | |
CleanObject | Sets the object to unmodified state. (Inherited from SqlSmoObject.) | |
CompareUrn | Compares two URNS. | |
CreateImpl | Creates an object with scripting options. (Inherited from SqlSmoObject.) | |
CreateImplFinish | Method called when the create event finishes. (Inherited from SqlSmoObject.) | |
CreateImplInit | Method called when the create event initializes. (Inherited from 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 | Discovers a list of type Object. (Inherited from SqlSmoObject.) | |
DropImpl | Drops a SqlSmoObject. (Inherited from SqlSmoObject.) | |
DropImplWorker | Calls the drop methods. (Inherited from 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 | Enumerates scripts specified by the so parameter. (Inherited from SqlSmoObject.) | |
EnumScriptImplWorker | Calls the methods that enumerate scripts specified by the so parameter. (Inherited from SqlSmoObject.) | |
EnumScriptImplWorkerSOChanged | Returns an IEnumerable string describing the scripting options for an object. (Inherited from 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 | (Inherited from Object.) | |
ExecuteNonQuery | Executes a batch in the context of the database where there are no results returned. (Inherited from SqlSmoObject.) | |
Finalize | (Inherited from Object.) | |
FormatSqlVariant | Formats an object as SqlVariant type. (Inherited from SqlSmoObject.) | |
GenerateDataSpaceFileStreamScript | Generates a script to create data file. (Inherited from SqlSmoObject.) | |
GenerateDataSpaceScript | Generates a script to allocate space in the data file. (Inherited from SqlSmoObject.) | |
GetActiveDBConnectionCount | Returns the number of active connections for the specified database. | |
GetBindDefaultScript | Gets the script that binds defaults specified by the defSchema and defName parameters. (Inherited from SqlSmoObject.) | |
GetBindRuleScript | Gets the script that specifies the binding rules. (Inherited from SqlSmoObject.) | |
GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32%) | Assigns a Boolean parameter of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
GetBoolParameter(StringBuilder, ScriptingOptions, String, String, Int32%, Boolean) | Assigns a Boolean property of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
GetDateTimeParameter | Assigns the datetime property of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
GetDateTimeParameterAsInt | Assigns the datetime property of the SqlSmoObject as an integer value if the datetime property is not null. (Inherited from SqlSmoObject.) | |
GetDBName | Gets the database name that is associated with the object. (Inherited from SqlSmoObject.) | |
GetDefaultInitFields | Returns the property types that are initialized by default when the specified object is initialized. | |
GetEnumParameter | Assigns an enumeration property of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
GetFragOptionString | Gets a FragmentationOption object as a string value. (Inherited from SqlSmoObject.) | |
GetGuidParameter | Assigns a Guid property of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
GetHashCode | (Inherited from Object.) | |
GetParameter(StringBuilder, ScriptingOptions, String, String, Int32%) | Assigns a parameter of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
GetParameter(StringBuilder, ScriptingOptions, String, String, Int32%, Boolean) | Assigns a parameter of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
GetPropertyNames | Returns the names of the initialized properties for the specified object type | |
GetPropValue | Gets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetPropValueOptional | Gets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetPropValueOptionalAllowNull | Gets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetRealValue | Gets a property value of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetScriptingOptionsForCreate | Gets ScriptingOptions for the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetServerName | Gets the name of the instance of SQL Server with which the object is associated. (Inherited from SqlSmoObject.) | |
GetServerObject | Gets the server of the SqlSmoObject object. (Inherited from 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. (Inherited from SqlSmoObject.) | |
GetStringComparer | Gets an IComparer interface. | |
GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32%) | Assigns a string parameter of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetStringParameter(StringBuilder, ScriptingOptions, String, String, Int32%, Boolean) | Assigns a string parameter of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetTimeSpanParameterAsInt | Assigns a time span parameter of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetType | (Inherited from Object.) | |
GetUrnRecursive(StringBuilder) | Assigns an Urn object of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
GetUrnRecursive(StringBuilder, UrnIdOption) | Assigns an Urn object of the SqlSmoObject object. (Inherited from 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 | Initializes the fields of the SqlSmoObject object. (Inherited from SqlSmoObject.) | |
Initialize() | Initializes the object and forces the properties be loaded. (Inherited from SqlSmoObject.) | |
Initialize(Boolean) | Initializes the object and forces the properties be loaded. (Inherited from 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. (Inherited from SqlSmoObject.) | |
IsObjectInitialized | Verifies whether the object has been initialized. (Inherited from SqlSmoObject.) | |
IsObjectInSpace | Verifies whether the object is isolated or connected to the instance of SQL Server. (Inherited from SqlSmoObject.) | |
IsVersion80SP3 | Determines whether the version of SQL Server is SQL Server 2000 with SP3. (Inherited from SqlSmoObject.) | |
IsVersion90AndAbove | Determines whether the version of SQL Server is SQL Server 2005 or later. (Inherited from 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 | Sets the SqlSmoState to dropped. (Inherited from SqlSmoObject.) | |
MarkForDropImpl | Sets the SqlSmoState to dropped. (Inherited from SqlSmoObject.) | |
MemberwiseClone | (Inherited from 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 | Method activated after the SqlSmoObject is altered. (Inherited from SqlSmoObject.) | |
PostCreate | Method activated after the SqlSmoObject is created. (Inherited from SqlSmoObject.) | |
PostDrop | Method activated after the SqlSmoObject is dropped. (Inherited from 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. (Overrides 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() | Generates a Transact-SQL script that can be used to re-create the server. | |
Script(ScriptingOptions) | Generates a Transact-SQL script that can be used to re-create the server by using the specified scripting options. | |
ScriptAlter | Alters the SqlSmoObject according to the parameters. (Inherited from SqlSmoObject.) | |
ScriptCreate | Alters the SqlSmoObject according to the parameters. (Inherited from SqlSmoObject.) | |
ScriptDdl | Throws InvalidSmoOperationException. (Inherited from SqlSmoObject.) | |
ScriptDrop | Throws InvalidSmoOperationException. (Inherited from SqlSmoObject.) | |
ScriptImpl() | Gets a collection of scripts of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
ScriptImpl(ScriptingOptions) | Gets a collection of scripts of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
ScriptImplWorker | Gets a collection of scripts of the SqlSmoObject. (Inherited from 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 | Sets the parent of the SqlSmoObject to the newParent parameter. (Inherited from SqlSmoObject.) | |
SetTraceFlag | Sets a trace flag. | |
ToString | Returns a String that represents the referenced object. (Inherited from SqlSmoObject.) | |
TouchImpl | Not implemented. (Inherited from SqlSmoObject.) | |
UnbindDefaultImpl | Unbinds the default columns of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
UnbindRuleImpl | Unbinds rules of the SqlSmoObject. (Inherited from SqlSmoObject.) | |
Validate | Validates the state of an object. (Inherited from SmoObjectBase.) |
Top
Events
Name | Description | |
---|---|---|
PropertyChanged | Represents the event that occurs when a property is changed. (Inherited from SqlSmoObject.) | |
PropertyMetadataChanged | Represents the event that occurs when property metadata changes. (Inherited from SqlSmoObject.) |
Top
Fields
Name | Description | |
---|---|---|
m_ExtendedProperties | Represents a property that is defined to extend the properties provided by a SqlSmoObject. (Inherited from SqlSmoObject.) | |
singletonParent | Represents the singleton parent. (Inherited from SqlSmoObject.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IAlienObject.Discover | Discovers any dependencies. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.) | |
IAlienObject.GetDomainRoot | Returns the root of the domain. (Inherited from SqlSmoObject.) | |
IAlienObject.GetParent | Gets the parent of this object. Do not reference this member directly in your code. It supports the SQL Server infrastructure. (Inherited from SqlSmoObject.) | |
IAlienObject.GetPropertyType | Gets the type of the specified property. (Inherited from SqlSmoObject.) | |
IAlienObject.GetPropertyValue | Gets the value of the specified property. (Inherited from SqlSmoObject.) | |
IAlienObject.GetUrn | Gets 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.) | |
IAlienObject.Resolve | Gets the instance that contains the information about the object from the Unified Resource Name of the object. (Inherited from SqlSmoObject.) | |
IAlienObject.SetObjectState | Sets the object state to the specified SfcObjectState value. (Inherited from SqlSmoObject.) | |
IAlienObject.SetPropertyValue | Sets the property value. (Inherited from SqlSmoObject.) | |
IAlienRoot.DesignModeInitialize | Identified 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. | |
IAlienRoot.SfcHelper_GetDataTable | Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets a DataTable object containing the results from a URN. | |
IAlienRoot.SfcHelper_GetSmoObject | Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets the Object that represents the object identified by a specified URN. | |
IAlienRoot.SfcHelper_GetSmoObjectQuery | Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets a List of String values. | |
ISfcDomainLite.DomainInstanceName | Gets the instance name of the domain. | |
ISfcDomainLite.DomainName | Gets the domain name. | |
ISfcDomainLite.GetLogicalVersion | Identified 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. | |
ISfcHasConnection.ConnectionContext | Gets the context for the connection represented by the current Server object. | |
ISfcHasConnection.GetConnection() | Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. Gets a connection to an Sfc backing store. | |
ISfcHasConnection.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. | |
ISfcHasConnection.SetConnection | Identified for informational purposes only. Not supported. Future compatibility is not guaranteed. Sets a connection to an Sfc backing store. | |
ISfcPropertyProvider.GetPropertySet | Gets 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.) | |
ISfcSupportsDesignMode.IsDesignMode | Gets a Boolean value that specifies whether the Server supports design mode. |
Top
Remarks
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.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also