Skip to content

Referencing 2 databases with same table name but 1st one has an addition columns returns error #849

@SailingNomad

Description

@SailingNomad

Describe the bug
If you have 2 databases with the same named table but different set of columns, when referencing the 2nd database the Provider throws an error that the columns in the first database table do not exist. In our application we support referencing multiple database configurations that all start with common tables and columns but each configuration can be customized.

To Reproduce
Steps to reproduce the behavior:

  1. Create 2 databases with a single table named Products. Both have an Id and Product Name. In the first database add one additional column - Sell_By_Date, allowing it to be NULL.
  2. Create a simple F# program to open a connection to both databases. Query the first database (the one with the extra column in it) and force the sequence to evaluate, then query the 2nd database and force the sequence to evaluate.
  3. See error: Invalid column name 'Sell_By_Date'.

Expected behavior
I expect the metadata for the 2nd instance would reflect the actual columns in the table.

Screenshots
Vanilla db used to build against:

Image Image Image

Sample program:

Image

Environment (please complete the following information):

  • Database: SqlServer V16.0.1145.1
  • Nuget Package and version: SQLProvider 1.5.12
  • OS: Windows 11
  • Dotnet 9

Additional context
We handle write operations to tables that we allow to have configuration-specific columns via T-SQL commands so this really only affects read-operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions