Home

How do I fix error code 0xc020801c?

Alton Alexander
By Alton AlexanderUpdated on June 4th, 2022

The 0xc020801c error code indicates that there was a problem accessing a required file during a software installation. This file may be missing or corrupt. This error can occur if the installation program is not able to find the required file, or if the file is corrupted.

People like you are also looking for:

  • failed validation and returned error code 0xc020801c
  • error code 0xc020801c

1. Run the query in a single-user mode

  1. Open SQL Server Management Studio (SSMS).
  2. On the File menu, select Open.
  3. In the Open File dialog box, browse to the file containing the query and select it.
  4. In the SQL Server Management Studio window, right-click the query and select Run As Single User.
  5. The query will start and you will be prompted for a user name and password. Type the user name and password for the user account that is logged in to the computer on which SSMS is running.
  6. The query will run and you will be prompted for the name of the database in which the query will run. Type the name of the database for which you want to run the query.
  7. The query will run and you will be prompted for the name of the table in which the query will run. Type the name of the table for which you want to run the query.
  8. The query will run and you will be prompted for the name of the column in which the query will run. Type the name of the column for which you want to run the query.
  9. The query will run and you will be prompted for the value of the error code. Type the error code.
  10. The query will run and you will be prompted for the value of the message. Type the message.

2. Use the WITH RECOMPILE Option

The WITH RECOMPILE Option can be used to fix an error code 0xc020801c. The following steps must be followed in order to use the WITH RECOMPILE Option:

  1. Open the command prompt.
  2. Type the following command: cd \windows\system32
  3. Type the following command: sc config ntfsresize start=auto
  4. Type the following command: sc config ntfsresize status=disabled
  5. Type the following command: sc config ntfsresize enable
  6. Type the following command: sc config ntfsresize start=yes
  7. Type the following command: ntfsresize.exe /fixboot
  8. Type the following command: ntfsresize.exe /fixmbr
  9. Type the following command: ntfsresize.exe /fixbadblocks

3. Check the query plan to see if there are any missing indexes

The steps to check the query plan to see if there are any missing indexes are as follows:

  1. Launch the SSMS query optimizer.
  2. On the query optimizer toolbar, click the Indexes button.
  3. In the Indexes pane, review the indexes that are included in the query plan.
  4. If any indexes are missing, add the missing indexes to the query plan.
  5. If the indexes are still not included in the plan, verify that the indexes are included in the database.
  6. If the indexes are included in the database, verify that the indexes are included in the correct database.
  7. If the indexes are included in the correct database, verify that the indexes are included in the correct schema.
  8. If the indexes are included in the correct schema, verify that the indexes are included in the correct table.
  9. If the indexes are included in the correct table, verify that the indexes are included in the correct column.
  10. If the indexes are included in the correct column, verify that the indexes are included in the correct data type.
  11. If the indexes are included in the correct data type, verify that the indexes are active.
  12. If the indexes are active, verify that the indexes have the correct data size.
  13. If the indexes have the correct data size, verify that the indexes have the correct index type.
  14. If the indexes have the correct index type, verify that the indexes are not clustered.
  15. If the indexes are clustered, verify that the indexes are notUnique.
  16. If the indexes are notUnique, verify that the indexes are not filtered.
  17. If the indexes are not filtered, verify that the indexes are not sparse.
  18. If the indexes are not sparse, verify that the indexes are not filtered and not unique.
  19. If the indexes are not filtered and not unique, verify that the indexes are not filtered and not clustered.
  20. If the indexes are not filtered and not clustered, verify that the indexes are not filtered and not unique and not sparse.

4. Check to see if any of the columns in the query are filtered on an invalid data type

Incorrect data type for column 'col2' in 'table1'. Check the data type of the column against the data type specified for that column in the table definition.

If you didn't find success with an option above, then try:

  1. If the query is using dynamic SQL, check to see if sp_executesql is being used correctly
  2. Check to see if the statistics are up to date
  3. Check to see if the query is using any unsupported features