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)]
31
30
32
-
This topic describes how to enable compression on a table or index in [!INCLUDE[ssCurrent](../../includes/sscurrent-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 a table or index in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)].
- System tables cannot be enabled for compression.
53
52
54
-
- 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. For a more information about data compression, see [Data Compression](../../relational-databases/data-compression/data-compression.md).
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).
55
54
56
55
- You cannot change the compression setting of a single partition if the table has nonaligned indexes.
3. Right-click the table or index to compress, point to **Storage** and select **Manage Compression...**.
72
71
73
-
4. In the Data Compression Wizard, on the **Welcome to the Data Compression Wizard** page, click**Next**.
72
+
4. In the Data Compression Wizard, on the **Welcome to the Data Compression Wizard** page, select**Next**.
74
73
75
-
5. On the **Select Compression Type** page, select the compression type to apply to each partition in the table or index you want to compress. When finished, click**Next**.
74
+
5. On the **Select Compression Type** page, select the compression type to apply to each partition in the table or index you want to compress. When finished, select**Next**.
76
75
77
76
The following options are available on the **Select Compression Type** page:
Displays the current space this partition occupies in megabytes (MB). This column is read-only.
96
95
97
96
**Requested Compressed Space**
98
-
After you click**Calculate**, this column displays the estimated size of each partition after compression by using the setting specified in the **Compression Type** column. This column is read-only.
97
+
After you select**Calculate**, this column displays the estimated size of each partition after compression by using the setting specified in the **Compression Type** column. This column is read-only.
99
98
100
99
**Calculate**
101
-
Click to estimate the size of each partition after compression by using the setting specified in the **Compression Type** column.
100
+
Select to estimate the size of each partition after compression by using the setting specified in the **Compression Type** column.
102
101
103
102
6. In the **Select an Output Option** page, specify how you want to complete your compression. Select **Create Script** to create a SQL script based the previous pages in the wizard. Select **Run immediately** to create the new partitioned table after completing all remaining pages in the wizard. Select **Schedule** to create the new partitioned table at a predetermined time in the future.
104
103
105
104
If you select **Create script**, the following options are available under **Script options**:
106
105
107
106
**Script to file**
108
-
Generates the script as a .sql file. Enter a file name and location in the **File name** box or click**Browse** to open the **Script File Location** dialog box. From **Save As**, select **Unicode text** or **ANSI text**.
107
+
Generates the script as a .sql file. Enter a file name and location in the **File name** box or select**Browse** to open the **Script File Location** dialog box. From **Save As**, select **Unicode text** or **ANSI text**.
109
108
110
109
**Script to Clipboard**
111
110
Saves the script to the Clipboard.
112
111
113
112
**Script to New Query Window**
114
113
Generates the script to a new Query Editor window. This is the default selection.
115
114
116
-
If you select **Schedule**, click**Change schedule**.
115
+
If you select **Schedule**, select**Change schedule**.
117
116
118
117
1. In the **New Job Schedule** dialog box, in the **Name** box, enter the job schedule's name.
- If you select **Monthly**, select either **Day** or **The**.
141
140
142
-
- If you select **Day**, enter both the date of the month you want the job schedule to run and how often the job schedule repeats in months. For example, if you want the job schedule to run on the 15th day of the month every other month, select **Day** and enter "15" in the first box and "2" in the second box. Please note that the largest number allowed in the second box is "99".
141
+
- If you select **Day**, enter both the date of the month you want the job schedule to run and how often the job schedule repeats in months. For example, if you want the job schedule to run on the 15th day of the month every other month, select **Day** and enter "15" in the first box and "2" in the second box. Note that the largest number allowed in the second box is "99".
143
142
144
-
- If you select **The**, select the specific day of the week within the month that you want the job schedule to run and how often the job schedule repeats in months. For example, if you want the job schedule to run on the last weekday of the month every other month, select **Day**, select **last** from the first list and **weekday** from the second list, and then enter "2" in the last box. You can also select **first**, **second**, **third**, or **fourth**, as well as specific weekdays (for example: Sunday or Wednesday) from the first two lists. Please note that the largest number allowed in the last box is "99".
143
+
- If you select **The**, select the specific day of the week within the month that you want the job schedule to run and how often the job schedule repeats in months. For example, if you want the job schedule to run on the last weekday of the month every other month, select **Day**, select **last** from the first list and **weekday** from the second list, and then enter "2" in the last box. You can also select **first**, **second**, **third**, or **fourth**, as well as specific weekdays (for example: Sunday or Wednesday) from the first two lists. Note that the largest number allowed in the last box is "99".
145
144
146
145
2. Under **Daily frequency**, specify how often the job schedule repeats on the day the job schedule runs:
147
146
148
147
- If you select **Occurs once at**, enter the specific time of day when the job schedule should run in the **Occurs once at** box. Enter the hour, minute, and second of the day, as well as AM or PM.
149
148
150
-
- If you select **Occurs every**, specify how often the job schedule runs during the day chosen under **Frequency**. For example, if you want the job schedule to repeat every 2 hours during the day that the job schedule is run, select **Occurs every**, enter "2" in the first box, and then select **hour(s)** from the list. From this list you can also select **minute(s)** and **second(s)**. Please note that the largest number allowed in the first box is "100".
149
+
- If you select **Occurs every**, specify how often the job schedule runs during the day chosen under **Frequency**. For example, if you want the job schedule to repeat every 2 hours during the day that the job schedule is run, select **Occurs every**, enter "2" in the first box, and then select **hour(s)** from the list. From this list you can also select **minute(s)** and **second(s)**. Note that the largest number allowed in the first box is "100".
151
150
152
151
In the **Starting at** box, enter the time that the job schedule should start running. In the **Ending at** box, enter the time that the job schedule should stop repeating. Enter the hour, minute, and second of the day, as well as AM or PM.
6. Under **Summary**, in **Description**, verify that all job schedule settings are correct.
159
158
160
-
7.Click**OK**.
159
+
7.Select**OK**.
161
160
162
-
After completing this page, click**Next**.
161
+
After completing this page, select**Next**.
163
162
164
-
7. On the **Review Summary** page, under **Review your selections**, expand all available options to verify that all compression settings are correct. If everything is as expected, click**Finish**.
163
+
7. On the **Review Summary** page, under **Review your selections**, expand all available options to verify that all compression settings are correct. If everything is as expected, select**Finish**.
165
164
166
165
8. On the **Compression Wizard Progress** page, monitor status information about the actions of the Create Partition Wizard. Depending on the options that you selected in the wizard, the progress page might contain one or more actions. The top box displays the overall status of the wizard and the number of status, error, and warning messages that the wizard has received.
Copies the results of the wizard's progress report into an email message.
196
195
197
-
When complete, click**Close**.
196
+
When complete, select**Close**.
198
197
199
198
## <aname="TsqlProcedure"></a> Using Transact-SQL
200
199
@@ -206,9 +205,9 @@ In SQL Server, run `sp_estimate_data_compression_savings` and then enable compre
206
205
207
206
1. In **Object Explorer**, connect to an instance of [!INCLUDE[ssDE](../../includes/ssde-md.md)].
208
207
209
-
2. On the Standard bar, click**New Query**.
208
+
2. On the Standard bar, select**New Query**.
210
209
211
-
3. Copy and paste the following example into the query window and click**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.
210
+
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.
212
211
213
212
```sql
214
213
USE AdventureWorks2012;
@@ -224,9 +223,9 @@ In SQL Server, run `sp_estimate_data_compression_savings` and then enable compre
224
223
225
224
1. In**Object Explorer**, connect to an instance of [!INCLUDE[ssDE](../../includes/ssde-md.md)].
226
225
227
-
2. On the Standard bar, click**New Query**.
226
+
2. On the Standard bar, select**New Query**.
228
227
229
-
3. Copy and paste the following example into the query window andclick**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. It then executes the stored procedure `sp_estimate_data_compression_savings` to return the estimated size of the specified index ID if it were to use the PAGE compression setting. Finally, the example rebuilds index ID 2 (`IX_TransactionHistory_ProductID`), specifying PAGE compression.
228
+
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. It then executes the stored procedure `sp_estimate_data_compression_savings` to return the estimated size of the specified index ID if it were to use the PAGE compression setting. Finally, the example rebuilds index ID 2 (`IX_TransactionHistory_ProductID`), specifying PAGE compression.
230
229
231
230
```sql
232
231
USE AdventureWorks2012;
@@ -248,15 +247,15 @@ In SQL Server, run `sp_estimate_data_compression_savings` and then enable compre
248
247
249
248
### On Azure SQL Database
250
249
251
-
Azure SQL Database does not support `sp_estimate_data_compression`. The following scripts enable compression without estimating the compression amount.
250
+
Azure SQL Database does not support the `sp_estimate_data_compression_savings` stored procedure. The following scripts enable compression without estimating the compression amount.
252
251
253
252
#### To enable compression on a table
254
253
255
254
1. In**Object Explorer**, connect to an instance of [!INCLUDE[ssDE](../../includes/ssde-md.md)].
256
255
257
-
2. On the Standard bar, click**New Query**.
256
+
2. On the Standard bar, select**New Query**.
258
257
259
-
3. Copy and paste the following example into the query window andclick**Execute**. The example enables ROW compression on all partitions in the specified table.
258
+
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.
260
259
261
260
```sql
262
261
USE AdventureWorks2012;
@@ -271,9 +270,9 @@ Azure SQL Database does not support `sp_estimate_data_compression`. The followin
271
270
272
271
1. In**Object Explorer**, connect to an instance of [!INCLUDE[ssDE](../../includes/ssde-md.md)].
273
272
274
-
2. On the Standard bar, click**New Query**.
273
+
2. On the Standard bar, select**New Query**.
275
274
276
-
3. Copy and paste the following example into the query window andclick**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.
275
+
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.
0 commit comments