Aracılığıyla paylaş


sp_helpstats (Transact-SQL)

Tabloda belirtilen sütun ve dizin ile ilgili istatistik bilgileri verir.

Important noteImportant Note:

This feature will be removed in the next version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.İstatistikler hakkında bilgi almak için sorgusys.statssys.stats_columns katalog görünümleri.

Topic link iconTransact-SQL sözdizimi kuralları

sp_helpstats[ @objname = ] 'object_name' 
     [ , [ @results = ] 'value' ]

Bağımsız değişkenler

  • [ @objname=] 'object_name'
    Specifies the table on which to provide statistics information.object_name is nvarchar(520) and cannot be null.Bir veya iki parçalı adı belirtilebilir.

  • [ @results=] 'value'
    Sağlamak için bilgi miktarını belirtir.Geçerli girdilerTüm and STATS.ALL lists statistics for all indexes and also columns that have statistics created on them; STATS only lists statistics not associated with an index.value is nvarchar(5) with a default of STATS.

Dönüş Kodu Değerleri

0 (başarılı) veya 1 (hatası)

Sonuç Kümeleri

Sonuç sütunları aşağıdaki tabloda açıklanmıştır küme.

sütun Name:

Açıklama

statistics_name

İstatistikler adıdır.Verirsysnameve olamaz null.

statistics_keys

İstatistikler, temel anahtarlar.Verirnvarchar(2078)ve olamaz null.

Remarks

DBCC SHOW_STATISTICS herhangi bir belirli dizin veya istatistikler hakkında ayrıntılı istatistik bilgilerini görüntülemek için kullanın.Daha fazla bilgi için bkz:DBCC SHOW_STATISTICS (Transact-SQL)vesp_helpindex (Transact-SQL).

İzinler

Üyelik gerektirenortak role.

Örnekler

Aşağıdaki örnek, tek - oluşturur sütun tüm uygun sütun s için tüm kullanıcı tablo istatistikleriniAdventureWorksveritabanı tarafından yürütülüyorsp_createstats.Daha sonrasp_helpstatsoluşturduğunuz sonuç istatistikleri bulmaya çalışanCustomerTablo.

USE AdventureWorks;
GO
EXEC sp_createstats;
GO
EXEC sp_helpstats 
@objname = 'Sales.Customer',
@results = 'ALL'

Here is the result set.

statistics_name                  statistics_keys
----------------------------------------------------------------
_WA_Sys_00000003_22AA2996        AccountNumber
AK_Customer_AccountNumber        AccountNumber
AK_Customer_rowguid              rowguid
CustomerType                     CustomerType
IX_Customer_TerritoryID          TerritoryID
ModifiedDate                     ModifiedDate
PK_Customer_CustomerID           CustomerID