次の方法で共有


AutoUpdateStatisticsEnabled プロパティ

データベースに関する統計データを自動的に更新するかどうかを示す Boolean プロパティ値を取得します。

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

構文

'宣言
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase Or SfcPropertyFlags.Deploy)> _
Public Property AutoUpdateStatisticsEnabled As Boolean
    Get
    Set
'使用
Dim instance As Database
Dim value As Boolean

value = instance.AutoUpdateStatisticsEnabled

instance.AutoUpdateStatisticsEnabled = value
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Deploy)]
public bool AutoUpdateStatisticsEnabled { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase|SfcPropertyFlags::Deploy)]
public:
virtual property bool AutoUpdateStatisticsEnabled {
    bool get () sealed;
    void set (bool value) sealed;
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Deploy)>]
abstract AutoUpdateStatisticsEnabled : bool with get, set
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase|SfcPropertyFlags.Deploy)>]
override AutoUpdateStatisticsEnabled : bool with get, set
final function get AutoUpdateStatisticsEnabled () : boolean
final function set AutoUpdateStatisticsEnabled (value : boolean)

プロパティ値

型: System. . :: . .Boolean
データベースに関する統計データを自動的に更新するかどうかを示す Boolean 値。
True の場合、データベースに関する統計データが自動的に更新されます。False (既定値) の場合、データベースに関する統計は自動的に更新されません。

実装

IDatabaseOptions. . :: . .AutoUpdateStatisticsEnabled

説明

AutoUpdateStatisticsEnabled プロパティは、ALTER DATABASE Transact-SQL ステートメントで AUTO_UPDATE_STATISTICS ON オプションを設定した場合と同じになります。

使用例

VB

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server

'Reference the AdventureWorks2008R2 database.
Dim db As Database
db = srv.Databases("AdventureWorks2008R2")

'Display the current options for statistics.
Console.WriteLine("Automatically create statistics = " + _
db.AutoCreateStatisticsEnabled.ToString)
Console.WriteLine("Automatically update statistics = " + _
db.AutoUpdateStatisticsEnabled.ToString)

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2008R2")
Write-Host "Automatically create statistics =" $db.AutoCreateStatisticsEnabled
Write-Host "Automatically update statistics =" $db.AutoUpdateStatisticsEnabled