Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

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

nahonix's profile image nahonix posted 5 months 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 5 months 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>, 5 months ago, revision 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 5 months 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 5 months 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 5 months ago Permalink

MariaDB 10.3.9

nahonix's profile image nahonix posted 5 months 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 5 months ago Permalink

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

ozyrys's profile image ozyrys posted 5 months 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 5 months 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 5 months 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 5 months 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 5 months ago Permalink

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

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




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.