Disable Compression on a Table or Index
This topic describes how to disable compression on a table or index in SQL Server 2012 by using SQL Server Management Studio or Transact-SQL.
In This Topic
-
Before you begin:
-
To disable compression on a table or index, using:
Limitations and Restrictions
-
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.
-
To evaluate how changing the compression state will affect a table, an index, or a partition, use the sp_estimate_data_compression_savings stored procedure.
-
You cannot change the compression setting of a single partition if the table has nonaligned indexes.
Security
To disable compression on a table
-
In Object Explorer, expand the database that contains the table on which you want to disable compression and then expand the Tables folder.
-
Right-click the table or index on which you want to disable compression, point to Storage and select Manage Compression….
-
To disable compression on an index, expand the table that contains the index and then expand the Indexes folder.
-
In the Data Compression Wizard, on the Welcome to the Data Compression Wizard page, click Next.
-
On the Select Compression Type page, select None as the compression type to apply to each partition in the index on which you want to disable compression. When finished, click Next.
The following options are available on the Select Compression Type page:
-
In the Select an Output Option page, specify how you want to complete this task. 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.
If you select Create script, the following options are available under Script options:
If you select Schedule, click Change schedule.
-
In the New Job Schedule dialog box, in the Name box, enter the job schedule’s name.
-
On the Schedule type list, select the type of schedule:
-
Start automatically when SQL Server Agent starts
-
Start whenever the CPUs become idle
-
Recurring. Select this option if your new partitioned table updates with new information on a regular basis.
-
One time. This is the default selection.
-
-
Select or clear the Enabled check box to enable or disable the schedule.
-
If you select Recurring:
-
Under Frequency, on the Occurs list, specify the frequency of occurrence:
-
If you select Daily, in the Recurs every box, enter how often the job schedule repeats in days.
-
If you select Weekly, in the Recurs every box, enter how often the job schedule repeats in weeks. Select the day or days of the week on which the job schedule is run.
-
If you select Monthly, select either Day or The.
-
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”.
-
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”.
-
-
-
Under Daily frequency, specify how often the job schedule repeats on the day the job schedule runs:
-
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.
-
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”.
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.
-
-
Under Duration, in Start date, enter the date that you want the job schedule to start running. Select End date or No end date to indicate when the job schedule should stop running. If you select End date, enter the date that you want to job schedule to stop running.
-
-
If you select One Time, under One-time occurrence, in the Date box, enter the date that the job schedule will be run. In the Time box, enter the time that the job schedule will be run. Enter the hour, minute, and second of the day, as well as AM or PM.
-
Under Summary, in Description, verify that all job schedule settings are correct.
-
Click OK.
After completing this page, click Next.
-
-
On the Review Summary page, under Review your selections, expand all available options to verify that all settings are correct. If everything is as expected, click Finish.
-
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.
The following options are available on the Compression Wizard Progress page:
When complete, click Close.
To disable compression on a table
-
In Object Explorer, connect to an instance of Database Engine.
-
On the Standard bar, click New Query.
-
Copy and paste the following example into the query window and click Execute.
USE AdventureWorks2012; GO ALTER TABLE Person.Person REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = NONE); GO
To disable compression on an index
-
In Object Explorer, connect to an instance of Database Engine.
-
On the Standard bar, click New Query.
-
Copy and paste the following example into the query window and click Execute.
USE AdventureWorks2012; GO ALTER INDEX AK_Person_rowguid ON Person.Person REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = NONE); GO
For more information, see ALTER TABLE (Transact-SQL) and ALTER INDEX (Transact-SQL).
