Skip to content

MSSQL FKs cannot be created if reference table in non-dbo schema #2467

@jonathanp12

Description

@jonathanp12

Description

Microsoft SQL Server foreign keys cannot be created if the reference table is in a non-dbo schema, an error occurs.

HeidiSQL version and OS

Version 12.17.0.7275 (64 Bit) on Windows 11 Pro

Database server version

Microsoft SQL Server 2025 (RTM) - 17.0.1000.7 (X64)

Reproduction recipe

  1. Connect to a Microsoft SQL Server instance
  2. Browse to a database with at least one table that has FKs
  3. Select the table, and then click on 'Foreign keys' tab
  4. Click on 'Add'
  5. Fill 'Columns', 'Reference table' (in a non-dbo schema) and 'Foreign columns'
  6. Save the changes
  7. See the error message

Error/Backtrace

SQL Error (1750): Foreign key '<name>' references invalid table '<name>'
Could not create constraint or index. See previous errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefective behaviour in HeidiSQLnettype-mssqlSQL Server specific issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions