Database.Alter メソッド (TimeSpan)

SQL Server のインスタンスの Database オブジェクトのプロパティに対する変更をすべて更新します。 

名前空間:  Microsoft.SqlServer.Management.Smo
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
Public Sub Alter ( _
    transactionTerminationTime As TimeSpan _
)
'使用
Dim instance As Database 
Dim transactionTerminationTime As TimeSpan

instance.Alter(transactionTerminationTime)
public void Alter(
    TimeSpan transactionTerminationTime
)
public:
void Alter(
    TimeSpan transactionTerminationTime
)
member Alter : 
        transactionTerminationTime:TimeSpan -> unit
public function Alter(
    transactionTerminationTime : TimeSpan
)

パラメーター

  • transactionTerminationTime
    型: System.TimeSpan
    Alter メソッドでプロパティの変更を保存する前にトランザクションを完了させるための時間を示す、TimeSpan オブジェクトの値です。

説明

Alter メソッドは、Database オブジェクトの作成後、または最後の Alter ステートメントの後に Database オブジェクトのプロパティに対して行われたすべての変更を更新します。 変更が結合され、1 回のネットワーク トリップで SQL Server のインスタンスに送信されます。

使用例

VB

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Define a Database object variable by supplying the server and the database name arguments in the constructor.
Dim db As Database
db = New Database(srv, "Test_SMO_Database")
'Create the database on the instance of SQL Server.
db.Create()
'Reference the database and display the date when it was created.
db = srv.Databases("Test_SMO_Database")
Console.WriteLine(db.CreateDate)
'Remove the database.
db.Drop()

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database($srv, "Test_SMO_Database")
$db.Create()
Write-Host $db.CreateDate
$db.Drop()

関連項目

参照

Database クラス

Alter オーバーロード

Microsoft.SqlServer.Management.Smo 名前空間

その他の技術情報

データベース オブジェクトでの作業

データベースの作成、変更、および削除

ALTER DATABASE (Transact-SQL)