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)

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

Property Value

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

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.

Return to top
Show: