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

Đang mở
#473 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python, sql
Lĩnh vực
databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
17.7k
Fork
1.7k
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/data-formulator

Tất cả issue của microsoft/data-formulator

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.