Share via


Login.DefaultDatabase-Eigenschaft

Gets or sets the default database that the login account is assigned to after logging on to the instance of SQL Server.

Diese API ist nicht mit CLS kompatibel. 

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase,  _
    "master")> _
<SfcReferenceAttribute(GetType(Database), "Server[@Name = '{0}']/Database[@Name = '{1}']",  _
    )> _
<CLSCompliantAttribute(False)> _
Public Property DefaultDatabase As String 
    Get 
    Set
'Usage
Dim instance As Login 
Dim value As String 

value = instance.DefaultDatabase

instance.DefaultDatabase = value
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase, 
    "master")]
[SfcReferenceAttribute(typeof(Database), "Server[@Name = '{0}']/Database[@Name = '{1}']", 
    )]
[CLSCompliantAttribute(false)]
public string DefaultDatabase { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase, 
    L"master")]
[SfcReferenceAttribute(typeof(Database), L"Server[@Name = '{0}']/Database[@Name = '{1}']", 
    )]
[CLSCompliantAttribute(false)]
public:
virtual property String^ DefaultDatabase {
    String^ get () sealed;
    void set (String^ value) sealed;
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase, 
    "master")>]
[<SfcReferenceAttribute(typeof(Database), "Server[@Name = '{0}']/Database[@Name = '{1}']", 
    )>]
[<CLSCompliantAttribute(false)>]
abstract DefaultDatabase : string with get, set
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase, 
    "master")>]
[<SfcReferenceAttribute(typeof(Database), "Server[@Name = '{0}']/Database[@Name = '{1}']", 
    )>]
[<CLSCompliantAttribute(false)>]
override DefaultDatabase : string with get, set
final function get DefaultDatabase () : String 
final function set DefaultDatabase (value : String)

Eigenschaftswert

Typ: System.String
A String value that specifies the default database to which the login account is assigned after logging on to the instance of SQL Server.

Implementiert

ILoginOptions.DefaultDatabase

Hinweise

Logins are assigned to a database by default after logging on to the instance of SQL Server that is equivalent to the USE DatabaseName Transact-SQL statement.

Beispiele

Verwalten von Benutzern, Rollen und Anmeldungen

Siehe auch

Verweis

Login Klasse

Microsoft.SqlServer.Management.Smo-Namespace

Andere Ressourcen

Prinzipale (Datenbankmodul)

CREATE LOGIN (Transact-SQL)