ExportVaultData Utility - MSSQL - Invalid date format
129
Created On 11/10/26 11:02 AM - Last Modified 11/10/26 13:03 PM
Symptom
Export Vault Data Utility fails when trying to export dates in formats other than MM/DD/YYYY.
The following ERROR can be found in the logs:
Error = [Microsoft][SQL Native Client]Invalid date format
SQLState = 22008, NativeError = 0
Environment
10.5;10.10;11.5;11.6;11.7;12.0;12.2;12.6;13.0 Privileged Access Manager (PAM, self-hosted) Export Vault Data EVD
Cause
When using the ExportVaultData Utility with machines using other regional settings such as DD/MM/YYYY format the utility fails due to the reason it tries to use the American date and time format.
Resolution
In order to make the ExportVaultData Utility support any Regional settings, please add -R flag in the end of the BCP command.
This flag will use regional settings (the default is ignoring it).
Before: bcp %Database%.[%TableOwner%].[CA%1] in %2 -S%3 -T -c -C65001 -t %4 -k -m%6 -b%6 -o %BCPOutFile% -e %BCPErrFile%
After: bcp %Database%.[%TableOwner%].[CA%1] in %2 -S%3 -T -c -C65001 -t %4 -k -m%6 -b%6 -o %BCPOutFile% -e %BCPErrFile% -R
After: bcp %Database%.[%TableOwner%].[CA%1] in %2 -S%3 -T -c -C65001 -t %4 -k -m%6 -b%6 -o %BCPOutFile% -e %BCPErrFile% -R
For additional BCP information please refer to: http://msdn.microsoft.com/en-us/library/ms162802.aspx
In addition, it is recommended to set the Local regional settings of the machine in which EVD is executed on as of the following:
1. Control Panel => Clock, Language and Region => Formats Tab => Make sure "Format" is defined as English (United States)
Confirm "Date and time formats" is "M/d/yyyy"
2. Control Panel => Clock, Language and Region => Location => Define Current Location as "United States".
Additional Information
Details
SYMPTOM:
Export Vault Data Utility fails when trying to export dates in formats other than MM/DD/YYYY.
The following ERROR can be found in the logs:
Error = [Microsoft][SQL Native Client]Invalid date format
SQLState = 22008, NativeError = 0
PROBLEM:
When using the ExportVaultData Utility with machines using other regional settings such as DD/MM/YYYY format the utility fails due to the reason it tries to use the American date and time format.
SOLUTION:
In order to make the ExportVaultData Utility support any Regional settings, please add -R flag in the end of the BCP command.This flag will use regional settings (the default is ignoring it).
Before: bcp %Database%.[%TableOwner%].[CA%1] in %2 -S%3 -T -c -C65001 -t %4 -k -m%6 -b%6 -o %BCPOutFile% -e %BCPErrFile%
After: bcp %Database%.[%TableOwner%].[CA%1] in %2 -S%3 -T -c -C65001 -t %4 -k -m%6 -b%6 -o %BCPOutFile% -e %BCPErrFile% -R
After: bcp %Database%.[%TableOwner%].[CA%1] in %2 -S%3 -T -c -C65001 -t %4 -k -m%6 -b%6 -o %BCPOutFile% -e %BCPErrFile% -R
For additional BCP information please refer to: http://msdn.microsoft.com/en-us/library/ms162802.aspx
In addition, it is recommended to set the Local regional settings of the machine in which EVD is executed on as of the following:
1. Control Panel => Clock, Language and Region => Formats Tab => Make sure "Format" is defined as English (United States)
Confirm "Date and time formats" is "M/d/yyyy"
2. Control Panel => Clock, Language and Region => Location => Define Current Location as "United States".