Skip to content

Arithmetic overflow when connecting to SQL Server with many/large dbs #1083

@crazycrank

Description

@crazycrank

Bug Description

Currently evaluating DBCode and running into a blocker with ms sql server.
When connecting and loading the database list it fails with 'Arithmetic overflow error converting expression to data type int'.

Claude assumes the issue is our many and sometimes huge databases, with sometized dozens of TB, and assumes there's some SUM aggregation over db size / row count which ends up being casted to int during the initial db load.

Repro steps

  1. Setup connection to database server with huge databases
  2. Expand the connection, so the database list is updated
  3. See error

Expected Behavior

The database list gets displayed and the connection to the server is established

Actual Behavior

The database load fails, the connections gets killed again. Logs in the output window

Connection: opened master on...
MSSQL: Error executing query on..., error: 'Arithmetic overflow error converting expression to data type int.'

Environment

  • DBCode version: 1.30.7
  • VS Code (or fork) version: 1.118.1
  • OS: Win 11 (client), Win datacenter 2022 (server)
  • Database: SQL server 2022 (16.0.4236.2)
  • Connection: direct, ssl with no verify

Error Meesages (if applicable)

MSSQL: Error executing query on..., error: 'Arithmetic overflow error converting expression to data type int.' 

Screenshots

N/A

Logs

If available, paste relevant logs from the Output panel (View > Output > DBCode).

Connection: opened master on... 
MSSQL: Error executing query on..., error: 'Arithmetic overflow error converting expression to data type int.' 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions