SQL Error (207): Invalid Column Name 'TABLE_NAME'

nahonix's profile image nahonix posted 3 years ago in General Permalink

When using MS SQL Server, the following error appears.

SQL Error (207): Invalid Column Name 'TABLE_NAME'

The following SQL derives the error...

SELECT * FROM "INFORMATION_SCHEMA"."CHECK_CONSTRAINTS" WHERE CONSTRAINT_SCHEMA='dbo' AND TABLE_NAME='...';

SOLUTION Change TABLE_NAME to CONSTRAINT_NAME

nahonix's profile image nahonix posted 3 years ago Permalink

This error box pops up every time you click on a MS SQL table.

Code modification/commit 6b60052 from Ansgar Becker <anse@heidisql.com>, 3 years ago, revision 11.1.0.6204
Issue #75: CHECK_CONSTRAINTS is there on MSSQL, but does not work due to missing TABLE_NAME column: https://www.heidisql.com/forum.php?t=37462
ansgar's profile image ansgar posted 3 years ago Permalink

That's interesting, so not only MySQL does not have that TABLE_NAME column, also MSSQL. I just modified the detection of check constraints, so it's disabled for MSSQL now. See also issue #75 - not yet finished.

ozyrys's profile image ozyrys posted 3 years ago Permalink

after update to (r6204) I got the same error:

/ SQL Error (1109): Unknown table 'CHECK_CONSTRAINTS' in information_schema /

ozyrys's profile image ozyrys posted 3 years ago Permalink

MariaDB 10.3.9

nahonix's profile image nahonix posted 3 years ago Permalink

@ansgar - thank you for the fix! Everything works now for me with MS SQL and MariaDB.

My Versions

MariaDB: 10.3.27

MS SQL: 12.0

nahonix's profile image nahonix posted 3 years ago Permalink

@ozyrs - download the latest release. That should fix your problem.

ozyrys's profile image ozyrys posted 3 years ago Permalink

@nahonix thank you, but I have r6204, and still have error, even closed HeidSQL and refresh list tables not helping

nahonix's profile image nahonix posted 3 years ago Permalink

You did post r6204 in your original post, sorry I did not notice that.

@ansgar - so MySQL would require a check to see if TABLE_CONSTRAINTS exists first before running...SELECT * from INFORMATION_SCHEMA.CHECK_CONSTRAINTS?

ansgar's profile image ansgar posted 3 years ago Permalink

Yes, this is a different error - ozyrys does not have the whole table IS.CHECK_CONSTRAINTS in MariaDB 10.3.9. Sigh, I'll go and add another version check.

ansgar's profile image ansgar posted 3 years ago Permalink

Next build will

  • dynamically check the existence of tables in information_schema
  • not try to run the constraint detection if CHECK_CONSTRAINTS table does not exist
  • silently fail once when that table exists, but does not have the TABLE_NAME column

These modifications will a) fix both of your issues, and b) remind me of incompatible detection of check constraints on many servers.

ozyrys's profile image ozyrys posted 3 years ago Permalink

@ansgar thank you! I confirm it work now :)

Please login to leave a reply, or register at first.