MSSQL connector fails to preview or import tables containing a `TIMESTAMP`/`ROWVERSION` column

Abierto
#473 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, sql
Área
databases

Línea de trabajo

Locate the MSSQL connector code that generates SELECT queries for table preview and import. The error shows the connector implicitly converts TIMESTAMP/ROWVERSION to nvarchar(max), which SQL Server forbids. Modify the query generation to handle this data type—cast to VARBINARY or skip the conversion. Test with the reproduction table to confirm the fix.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Environment
  • Microsoft Data Formulator running in Docker
  • Ubuntu Server 24.04
  • Microsoft SQL Server 2022
  • MSSQL Python driver (mssql_python, as shown in the application log)
Description

When I try to preview or import a SQL Server table that contains a TIMESTAMP column, the operation fails. In SQL Server, TIMESTAMP is a synonym for ROWVERSION—it stores a binary row version, not a date or time.

Minimal reproduction
CREATE TABLE dbo.Repro (
    Id int NOT NULL PRIMARY KEY,
    RowVersionColumn timestamp NOT NULL,
    SysStartTime datetime2(7) GENERATED ALWAYS AS ROW START NOT NULL,
    SysEndTime datetime2(7) GENERATED ALWAYS AS ROW END NOT NULL,
    PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime)
)
WITH (
    SYSTEM_VERSIONING = ON (
        HISTORY_TABLE = dbo.ReproHistory
    )
);
  1. Connect Data Formulator to the SQL Server database.
  2. Select dbo.Repro.
  3. Try to preview or import the table.
Expected behavior

The table should be previewed and imported successfully, with the ROWVERSION column handled as binary data or otherwise handled safely.

Actual behavior

Both preview and import fail with a data-load error. The SQL Server driver reports:

Invalid character value for cast specification;
[Microsoft][SQL Server] Explicit conversion of the timestamp data type
to nvarchar(max) is not allowed.

The error occurs while executing the generated SELECT query.

Lenguaje dominante
Python
Estrellas
17.7k
Forks
1.7k
Merge medio
4 d 1 h
PR fusionados (30 d)
8

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/data-formulator

Todos los issues de microsoft/data-formulator

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.