You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW ](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
30
30
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.
32
32
33
33
**In this article**
34
34
@@ -53,11 +53,13 @@ This article describes how to enable [data compression](../../relational-databas
53
53
- 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).
54
54
55
55
- 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).
56
58
57
59
### <aname="Security"></a> Security
58
60
59
61
#### <aname="Permissions"></a> Permissions
60
-
Requires ALTER permission on the table or index.
62
+
Requires `ALTER` permission on the table or index.
61
63
62
64
## <aname="SSMSProcedure"></a> Using SQL Server Management Studio
63
65
@@ -210,7 +212,7 @@ In SQL Server, run `sp_estimate_data_compression_savings` and then enable compre
210
212
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.
@@ -258,7 +260,7 @@ Azure SQL Database does not support the `sp_estimate_data_compression_savings` s
258
260
3. Copy and paste the following example into the query window andselect**Execute**. The example enables ROW compression on all partitions in the specified table.
259
261
260
262
```sql
261
-
USE AdventureWorks2012;
263
+
USE AdventureWorks2016;
262
264
GO
263
265
264
266
ALTER TABLE Production.TransactionHistory REBUILD PARTITION = ALL
@@ -275,7 +277,7 @@ Azure SQL Database does not support the `sp_estimate_data_compression_savings` s
275
277
3. Copy and paste the following example into the query window andselect**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.
276
278
277
279
```sql
278
-
USE AdventureWorks2012;
280
+
USE AdventureWorks2016;
279
281
GO
280
282
SELECT name, index_id
281
283
FROM sys.indexes
@@ -289,6 +291,7 @@ Azure SQL Database does not support the `sp_estimate_data_compression_savings` s
0 commit comments