Microsoft SQL ODBC Backup "The length of the device name provided exceeds supported limit"
10 Mar, 2025
Product Version
AhsayOBM: 7 and above
Operating System
Windows
Symptom
When performing a MS SQL database backup (ODBC backup mode), the following error message is received in the backup report:
No. | Type | Timestamp | Log |
* | ... | ... | ... |
* | info | ... | [Start] Backing up "SQL_hostname\...\long_db_name" ... to "temp_path\long_db_name" |
* | warn | YYYY/MM/DD hh:mm:ss | [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid device name. The length of the device name provided exceeds supported limit (maximum length is:259). Reissue the BACKUP statement with a valid device name. |
* | ... | ... | ... |
Cause
This is a warning message returned by the SQL server, suggesting that length of the directory path to the backup device (e.g. temporary folder path plus the database name) exceeded 259 characters.
The maximum number of characters is a limit imposed by the SQL server and not AhsayOBM.
Resolution
To resolve the issue:
Option 1 - Modify the temporary directory for storing backup files to a shorter directory path:
OR
Option 2 - Rename the database to a shorter name if possible. (Instructions)
OR
Option 3 - Create a new MS SQL Server backup set in VSS backup mode: