Database.AutoCreateStatisticsEnabled Database.AutoCreateStatisticsEnabled Database.AutoCreateStatisticsEnabled Property

정의

데이터베이스에 대해 통계가 자동으로 만들어지는지 여부를 지정하는 값을 가져옵니다. Gets a value that specifies whether statistics are automatically created for the database.

public:
 property bool AutoCreateStatisticsEnabled { bool get(); void set(bool value); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcProperty(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Standalone | Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.SqlAzureDatabase | Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Deploy)]
public bool AutoCreateStatisticsEnabled { get; set; }
Public Property AutoCreateStatisticsEnabled As Boolean
속성 값

A Boolean 데이터베이스에 대 한 통계를 자동으로 만들지 여부를 지정 하는 값입니다. A Boolean value that specifies whether statistics are automatically created for the database. 경우 True, 데이터베이스에 대해 통계가 자동으로 만들어집니다. If True, statistics are automatically created for the database. 그렇지 않으면 False (기본값). Otherwise, False (default).

구현

예제

VBVB

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

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

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

PowerShellPowerShell

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

설명

AutoCreateStatisticsEnabled 속성은 ALTER DATABASE Transact-SQL 문에서 AUTO_CREATE_STATISTICS ON 옵션을 설정하는 것과 같습니다.The AutoCreateStatisticsEnabled property is equivalent to setting the AUTO_CREATE_STATISTICS ON option in the ALTER DATABASE Transact-SQL statement.

적용 대상