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
- Connect to a Microsoft SQL Server instance
- Browse to a database with at least one table that has FKs
- Select the table, and then click on 'Foreign keys' tab
- Click on 'Add'
- Fill 'Columns', 'Reference table' (in a non-dbo schema) and 'Foreign columns'
- Save the changes
- 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.
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
Error/Backtrace