Compartilhar via


Propriedade do RDL DefaultDatabase

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

Essa API não é compatível com CLS. 

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

Sintaxe

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

value = instance.DefaultDatabase

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

Valor da propriedade

Tipo: 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.

Implementa

ILoginOptions. . :: . .DefaultDatabase

Comentários

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.