Installing and configuring the ODBC Driver 4.x for Windows

Version: 4.x. Switch to ODBC 3.x · Choose another task.

Windows utilizes named data sources (DSNs) for connecting ODBC-based client applications to Snowflake.

Important

These instructions install ODBC 4.x. Installing 4.x replaces 3.x on the machine. If you currently use 3.x, read the migration guide and validate on a separate host first. To stay on 3.x, use the 3.x Windows instructions.

Prerequisites

Operating system

For a list of the operating systems supported by Snowflake clients, see Operating system support.

Administrator privileges

To install the ODBC driver, you need administrator-level privileges so that the driver can be installed in the C:\Program Files directory.

Microsoft Visual C++ Redistributable

To use the Snowflake ODBC Driver on Windows, install the latest supported Microsoft Visual C++ v14 Redistributable for your application and driver architecture.

You can download the installation file from:

Microsoft Visual C++ Redistributable latest supported downloads

Step 1: Install the ODBC Driver

  1. If you haven’t already downloaded the latest driver version, download it now. For details, see Downloading the ODBC Driver 4.x. Use snowflake-odbc-<version>.x86_64.msi, snowflake-odbc-<version>.x86_32.msi, or snowflake-odbc-<version>.aarch64.msi to match the application architecture.

  2. Double-click the downloaded .msi file.

    The driver is installed in %ProgramFiles%\Snowflake ODBC Driver\.

Step 2: Configure the ODBC Driver

To configure the ODBC driver in a Windows environment, create a DSN for the driver:

  1. Launch the Windows Data Source Administration Tool:

    Search on your Windows machine for the launcher for the ODBC Data Source Administration Tool:

    Once you find the ODBC administration tool, click on the tool to launch it and display the set up window.

  2. Verify that the Snowflake ODBC driver is installed:

    Navigate to the Drivers tab in the set up window and verify that the driver (Snowflake ODBC) appears:

    If you do not see Snowflake ODBC, then the Snowflake ODBC driver installation did not complete successfully and you need to re-install it.

  3. Create a new DSN:

    1. Navigate to the User DSN or System DSN tab and click the Add button:

    2. Select Snowflake ODBC from the list of installed drivers.

    3. Enter the connection parameters for the driver.

      In the fields provided in Snowflake Configuration dialog, enter the parameters for the DSN:

      When entering parameters, note the following:

      • Data Source, User and Server are the only parameters required to create a DSN.

        For more information on these parameters, see Required connection parameters.

      • All other parameters in the dialog are optional. In particular, the Authenticator should be changed from the default (“snowflake”) only if needed. For more details about ODBC Data Source parameters, see ODBC configuration and connection parameters and, in particular, Optional connection parameters.

      • The Password field accepts a value, but does not store the value. This is a security precaution to ensure passwords are never stored directly in the driver.

      • Version 4.x does not save the Proxy, Private key password, or Client Secret fields. To set a proxy, see Configure a proxy.

      • Version 4.x no longer shows a Tracing(0-6) field. Configure driver logging in sf.odbc.ini. See Configuration differences.

      Note

      • The ODBC driver supports additional parameters that are not displayed in the dialog. These parameters can only be set in the Windows registry using regedit.

        For descriptions of all the parameters, see ODBC configuration and connection parameters.

      • Windows stores DSNs in the registry. If your organization’s policy blocks registry writes, you might not be able to create or change a DSN in the dialog. In that case, use a DSN-less connection string instead. For key pair authentication, see the PRIV_KEY_FILE parameter in ODBC configuration and connection parameters.

      • Avoid saving a private key passphrase (PRIV_KEY_FILE_PWD) in a DSN, because DSN values are stored in the registry as plain text. Instead, supply the passphrase in the connection string when you connect.

      • Set Authenticator to the value for your authentication method. To authenticate with a password and multi-factor authentication (MFA) with MFA token caching, set Authenticator to username_password_mfa. For other methods, such as federated authentication or OAuth, see the authenticator parameter description in ODBC configuration and connection parameters. For MFA configuration and token-caching requirements, see Using multi-factor authentication.

    4. Click OK to create the DSN.

You can now reference this DSN in ODBC-based client applications for connecting to Snowflake.

Configure a proxy

In ODBC 4.x, the DSN setup dialog does not save parameters that can contain credentials: PROXY (Proxy), PRIV_KEY_FILE_PWD (Private key password), and OAUTH_CLIENT_SECRET (Client Secret). Because a proxy URL can contain a user name and password, the dialog never saves PROXY, even when the value has no credentials. It does not show a warning. The NoProxy field is saved.

To confirm what was saved, check the DSN’s registry key after you click OK. If PROXY is missing, set it with one of the following methods.

To set a proxy:

  • Add PROXY to the connection string, for example DSN=<DSN_NAME>;PROXY=proxyserver.example.com:80.
  • Add PROXY as a String Value under the DSN’s registry key. See Setting parameters in Windows.
  • Set USE_PROXY_ENV=true on the connection, and set the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables. See Connecting through a proxy server.

A PROXY value in the connection string overrides the value stored in the DSN. If you add PROXY to the registry manually, the dialog keeps the value when you save the DSN, but does not update it. To change the value, edit it in the registry.

Configure logging

For ODBC 4.x, create %APPDATA%\snowflake\sf.odbc.ini for the user running the application, or set SF_ODBC_INI to the full path of your configuration file before starting the application. %APPDATA% is the Roaming AppData directory. Create the directory if it does not exist, and ensure the user can write to LogPath.

LogLevel=INFO
LogPath=C:\Users\<user>\snowflake-logs

Do not use the 3.x driver registry key or numeric log levels for 4.x logging. See configuration differences for all supported keys and the file search order.

Step 3: Test the connection

Connect from the ODBC application using the DSN you configured. Use an application and driver with matching architectures. Confirm that the application reports the installed 4.x driver version. If you are migrating an existing application, continue with the migration validation steps.