Ócáid
Mar 31, 11 PM - Apr 2, 11 PM
An ócáid foghlama SQL, Fabric and Power BI is mó. Márta 31 – 2 Aibreán. Bain úsáid as cód FABINSIDER chun $ 400 a shábháil.
Cláraigh inniuNí thacaítear leis an mbrabhsálaí seo a thuilleadh.
Uasghrádú go Microsoft Edge chun leas a bhaint as na gnéithe is déanaí, nuashonruithe slándála, agus tacaíocht theicniúil.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
SQL database in Microsoft Fabric
This topic describes how to modify the properties of an index in SQL Server by using SQL Server Management Studio or Transact-SQL.
In This Article
Before you begin:
To modify the properties of an index, using:
Requires ALTER permission on the table or view.
The following example shows the properties of all indexes in a table in the AdventureWorks database.
SELECT i.name AS index_name
, i.type_desc
, i.is_unique
, ds.type_desc AS filegroup_or_partition_scheme
, ds.name AS filegroup_or_partition_scheme_name
, i.ignore_dup_key
, i.is_primary_key
, i.is_unique_constraint
, i.fill_factor
, i.is_padded
, i.is_disabled
, i.allow_row_locks
, i.allow_page_locks
, i.has_filter
, i.filter_definition
FROM sys.indexes AS i
INNER JOIN sys.data_spaces AS ds
ON i.data_space_id = ds.data_space_id
WHERE is_hypothetical = 0 AND i.index_id <> 0
AND i.object_id = OBJECT_ID('HumanResources.Employee')
;
The following examples set the properties of indexes in the AdventureWorks database.
ALTER INDEX AK_SalesOrderHeader_SalesOrderNumber ON
Sales.SalesOrderHeader
SET (
STATISTICS_NORECOMPUTE = ON,
IGNORE_DUP_KEY = ON,
ALLOW_PAGE_LOCKS = ON
)
;
ALTER INDEX ALL ON Production.Product
REBUILD WITH
(
FILLFACTOR = 80
, SORT_IN_TEMPDB = ON
, STATISTICS_NORECOMPUTE = ON
)
;
For more information, see ALTER INDEX (Transact-SQL).
Ócáid
Mar 31, 11 PM - Apr 2, 11 PM
An ócáid foghlama SQL, Fabric and Power BI is mó. Márta 31 – 2 Aibreán. Bain úsáid as cód FABINSIDER chun $ 400 a shábháil.
Cláraigh inniuOiliúint
Modúl
Configure databases for optimal performance - Training
Configure databases for optimal performance
Doiciméadúchán
Modify an Index
Index Properties F1 Help - SQL Server
Index Properties F1 Help
Create indexes with included columns - SQL Server
Create indexes with included columns