Skip to content

MS Fabric schema export appears to need capital letters on table names #1705

Closed

Description

@Octacon100

Here there,

Was trying to connect the datacontract-cli to a Fabric Warehouse, and was getting errors saying that the information_schema.tables view did not exist.

Fixed it by putting all the view in upper case, can we check to see if the connection is a Fabric Warehouse and use capital letters instead?

Here's what I did to fix the selects, it created a data contract after that:

In the sqlserver_importer.py file, lines 39-66:

_TABLES_QUERY = """
    SELECT table_name, table_type
    FROM INFORMATION_SCHEMA.TABLES
    WHERE table_schema = '{schema}'
"""
##########################
# SQL Server reports the type in parts (base type plus length / precision /
# scale). reconstruct_native_type() reassembles them exactly as the test path
# reads them back, including the -1 that means MAX, so an imported physicalType
# matches on the first `datacontract test`.
##########################

_COLUMNS_QUERY = """
    SELECT table_name, column_name, data_type, character_maximum_length,
           numeric_precision, numeric_scale, is_nullable
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE table_schema = '{schema}'
    ORDER BY table_name, ordinal_position
"""

_PRIMARY_KEYS_QUERY = """
    SELECT kcu.table_name, kcu.column_name, kcu.ordinal_position
    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
    JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
      ON tc.constraint_name = kcu.constraint_name
     AND tc.table_schema = kcu.table_schema
    WHERE tc.constraint_type = 'PRIMARY KEY'
      AND tc.table_schema = '{schema}'
    ORDER BY kcu.table_name, kcu.ordinal_position
"""

Thanks!

Activity

  1. added
    bug
    on Oct 6, 2026
  2. Octacon100 commented on Oct 6, 2026

    @Octacon100
    ContributorAuthor

    Made a pull request to fix this here: Fix for Fabric warehouses- #1707 -#1707

  3. linked a pull request that will close this issueFix for Fabric warehouses #1707on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions