SQL error

Posted by John Liu on Thursday, November 25, 2021

1. “Cannot load Counter Name data because an invalid index”

When trying to install SQL2019 PolyBase (and possibly other programs as well), you may receive error “Cannot load Counter Name data because an invalid index” exception

To fix this error, start CMD as administrator and run

C:\WINDOWS\System32> lodctr /r

then run

C:\WINDOWS\SysWOW64> lodctr /r

If all success, you should receive message: “Info: Successfully rebuilt performance counter setting from system backup store”

2. “External data sources are not supported with type GENERIC”

When trying to create EXTERNAL DATA SOURCE, you received “External data sources are not supported with type GENERIC” exception. This error indicates that PolyBase has not been installed or enabled.

To check if PolyBase is installed:

SELECT SERVERPROPERTY('IsPolyBaseInstalled');

If above query returns 0, you need to install PolyBase first. If it returns 1, then need to enable the configuration:

EXEC sp_configure 'polybase enabled',1;
RECONFIGURE;

3. “Login Failed. The Login is From an Untrusted Domain and Cannot be Used with Windows Authentication”

When trying to create EXTERNAL DATA SOURCE in PolyBase on a local SQL instance, I received the “Login Failed. The Login is From an Untrusted Domain and Cannot be Used with Windows Authentication” exception. This is some kind of loopback, check taking in place which caused trusted connections via the loopback adapter to fail.

Add a registry entry to disable loopback check, navigate to HKLM\System\CurrentControlSet\Control\Lsa and add a DWORD key named “DisableLoopbackCheck” and set the value to 1.

If the above registry trick does not work, you need to create SPNs for SQL Service account using tool “Microsoft® Kerberos Configuration Manager for SQL Server®” which can be downloaded at https://www.microsoft.com/en-us/download/details.aspx?id=39046

4. “General error Unable to open registry key Temporary (volatile) Ace DSN for process”

When trying open fiel using EXTERNAL DATA SOURCE in PolyBase, you may receive “General error Unable to open registry key Temporary (volatile) Ace DSN for process” exception.

This is the top-level error message produced by the Access Database Engine (a.k.a. “ACE”) ODBC driver when the current process is unable to open the Access database file for one of the following reasons:

  1. Some other process has opened the database “exclusively”.

  2. Some other process originally opened the database file in Access as “shared” and has some pending structural modification that requires “exclusive” access to the file. Examples of such pending modifications are edits to Module code that have not yet been saved, or having a Form or Report open in Design View.

  3. The account under which the current process is running does not have sufficient filesystem permissions to open the database file or the folder in which it resides. If need to change service account, need to reinstall PolyBase.

  4. The account under which the current process is running does not have sufficient registry permissions to access the values under the HKLM\SOFTWARE\ODBC key.

  5. The database file simply does not exist.

  6. The database you are trying to open requires a newer version of Microsoft Access.

Fix for each scenario https://stackoverflow.com/questions/26244425/general-error-unable-to-open-registry-key-temporary-volatile-from-access