Skip to content

Commit bcb512d

Browse files
authored
Update enable-compression-on-a-table-or-index.md
1 parent 3c2a020 commit bcb512d

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

docs/relational-databases/data-compression/enable-compression-on-a-table-or-index.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ monikerRange: ">= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest |
2828

2929
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW ](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
3030

31-
This article describes how to enable [data compression](../../relational-databases/data-compression/data-compression.md) on a table or index in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)].
31+
This article describes how to enable [data compression](../../relational-databases/data-compression/data-compression.md) on an existing table or index in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)]. To enable data compression when creating a table or index, see the [Create a compressed index](../../t-sql/statements/create-index-transact-sql.md#l-create-a-compressed-index) and [Creating a table that uses row compression](../../t-sql/statements/create-table-transact-sql.md#n-creating-a-table-that-uses-row-compression) examples.
3232

3333
**In this article**
3434

@@ -53,11 +53,13 @@ This article describes how to enable [data compression](../../relational-databas
5353
- If the table is a heap, the rebuild operation for ONLINE mode will be single threaded. Use OFFLINE mode for a multi-threaded heap rebuild operation. Rebuild operations are OFFLINE unless you specify the ONLINE option. For complete information on performing an ONLINE rebuild, see [Perform Index Operations Online](../indexes/perform-index-operations-online.md).
5454

5555
- You cannot change the compression setting of a single partition if the table has nonaligned indexes.
56+
57+
- Several data types are not affected by data compression. For more detail, see [How row compression affects storage](../../relational-databases/data-compression/row-compression-implementation.md#how-row-compression-affects-storage).
5658

5759
### <a name="Security"></a> Security
5860

5961
#### <a name="Permissions"></a> Permissions
60-
Requires ALTER permission on the table or index.
62+
Requires `ALTER` permission on the table or index.
6163

6264
## <a name="SSMSProcedure"></a> Using SQL Server Management Studio
6365

@@ -210,7 +212,7 @@ In SQL Server, run `sp_estimate_data_compression_savings` and then enable compre
210212
3. Copy and paste the following example into the query window and select **Execute**. The example first executes the stored procedure `sp_estimate_data_compression_savings` to return the estimated size of the object if it were to use the ROW compression setting. The example then enables ROW compression on all partitions in the specified table.
211213

212214
```sql
213-
USE AdventureWorks2012;
215+
USE AdventureWorks2016;
214216
GO
215217
EXEC sp_estimate_data_compression_savings 'Production', 'TransactionHistory', NULL, NULL, 'ROW' ;
216218

@@ -258,7 +260,7 @@ Azure SQL Database does not support the `sp_estimate_data_compression_savings` s
258260
3. Copy and paste the following example into the query window and select **Execute**. The example enables ROW compression on all partitions in the specified table.
259261

260262
```sql
261-
USE AdventureWorks2012;
263+
USE AdventureWorks2016;
262264
GO
263265
264266
ALTER TABLE Production.TransactionHistory REBUILD PARTITION = ALL
@@ -275,7 +277,7 @@ Azure SQL Database does not support the `sp_estimate_data_compression_savings` s
275277
3. Copy and paste the following example into the query window and select **Execute**. The example first queries the `sys.indexes` catalog view to return the name and `index_id` for each index on the `Production.TransactionHistory` table. Finally, the example rebuilds index ID 2 (`IX_TransactionHistory_ProductID`), specifying PAGE compression.
276278

277279
```sql
278-
USE AdventureWorks2012;
280+
USE AdventureWorks2016;
279281
GO
280282
SELECT name, index_id
281283
FROM sys.indexes
@@ -289,6 +291,7 @@ Azure SQL Database does not support the `sp_estimate_data_compression_savings` s
289291

290292
## See Also
291293
[Data Compression](../../relational-databases/data-compression/data-compression.md)
292-
[sp_estimate_data_compression_savings &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-estimate-data-compression-savings-transact-sql.md)
293-
294+
[sp_estimate_data_compression_savings &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-estimate-data-compression-savings-transact-sql.md)
295+
[Create a compressed index](../../t-sql/statements/create-index-transact-sql.md#l-create-a-compressed-index)
296+
[Creating a table that uses row compression](../../t-sql/statements/create-table-transact-sql.md#n-creating-a-table-that-uses-row-compression)
294297

0 commit comments

Comments
 (0)