TechNet
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Server.Databases Property

 

Represents a collection of Database objects. Each Database object represents a database defined on the instance of SQL Server.

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

No code example is currently available or this language may not be supported.

Property Value

Type: Microsoft.SqlServer.Management.Smo.DatabaseCollection

A DatabaseCollection object that represents all the databases defined on the instance of SQL Server.

Specific databases can be referenced by using this collection and specifying the name of the database. To create a new database, call the database constructor Database.

Visual Basic

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = $srv.Databases.Item("AdventureWorks2012")
$tb = $db.Tables.Item("Person", "Person")
$col = $tb.Columns.Item("LastName")
$col.Nullable = $TRUE
$col.Alter()
Return to top
Show:
© 2016 Microsoft