Environment Variables¶
Every setting available in the mds_global.ini file can also be set through an environment variable. This is useful for quick, temporary overrides — for example, enabling a trace before launching your application without editing any configuration files.
Naming Convention¶
To set an mds_global.ini setting via an environment variable, prefix the setting name with btr2sql_:
btr2sql_<SETTING_NAME>
For example, the mds_global.ini setting TRACE_ON becomes the environment variable btr2sql_TRACE_ON.
How It Works¶
When the driver starts, it checks for environment variables in addition to the mds_global.ini file. Environment variables sit below the mds_global.ini in the precedence order — meaning an mds_global.ini setting will override an environment variable if both are present.
Important
Environment variables are evaluated at driver load time. If you change an environment variable while the application is running, the driver will not pick up the new value until the application is restarted.
Enabling and Disabling on the Fly¶
Environment variables are especially handy for ad-hoc debugging. You can set them in your terminal session immediately before running your application, and they disappear when the session ends.
Windows Command Prompt (cmd)
set btr2sql_TRACE_ON=c:\trace\sql_btr.tra
set btr2sql_TRACE_LEVEL=-3
myapp.exe
rem Trace is active for this run only.
rem Close the terminal or unset the variables to stop tracing:
set btr2sql_TRACE_ON=
set btr2sql_TRACE_LEVEL=
Windows PowerShell
$env:btr2sql_TRACE_ON = "c:\trace\sql_btr.tra"
$env:btr2sql_TRACE_LEVEL = "-3"
.\myapp.exe
# Remove when done:
Remove-Item Env:btr2sql_TRACE_ON
Remove-Item Env:btr2sql_TRACE_LEVEL
Tip
Setting an environment variable to an empty string (e.g., set btr2sql_TRACE_ON=) effectively removes it. The driver will fall back to the next source in the precedence order (registry, then driver defaults).
Supported Environment Variables¶
Every mds_global.ini setting listed below can be used as an environment variable by adding the btr2sql_ prefix. Click any setting name for full documentation.
Trace Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Locking Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
Performance Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
|
|
|
|
Connection Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
Data Handling Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
|
|
|
|
|
|
Security and Control Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
Language and Localization Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
Version Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
|
|
File and Path Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
Cache Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|
|
|
Debug Settings
Environment Variable |
mds_global.ini Setting |
|---|---|
|