Export (0) Print
Expand All

Login.DefaultDatabase Property

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

This API is not CLS-compliant. 

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

[CLSCompliantAttribute(false)]
[SfcReferenceAttribute(typeof(Database), "Server[@Name = '{0}']/Database[@Name = '{1}']", 
	)]
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Matrix, 
	"master")]
public string DefaultDatabase { get; set; }

Property Value

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

Implements

ILoginOptions.DefaultDatabase

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.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft