Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5947725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:00:18+00:00 2026-05-22T17:00:18+00:00

I need to check foreign key constraints on a schemas. I need the table

  • 0

I need to check foreign key constraints on a schemas. I need the table name, the column name, the referenced schema, the referenced table and the referenced column. Google search tells me that I could do this using information_schema. I have some doubts regarding this approach.

  1. Is the information schema reliable? I have too many large databases containing too many tables and any errors would be costly
  2. Considering information_schema is a system database and contains info about all databases, any query will take considerably longer. Right?

Is there an alternate method to check foreign key constraints? Using SHOW CREATE TABLE and comparing queries does not seem to be a very good idea.

My application will be coded in C# (Connector:ODBC). I know there is a .NET MySQL connector which provides Foreign Key Columns collection for the getschema method (http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-connecting-connection-string.html#connector-net-programming-getschema). Does anyone know if it uses information_schema too?

I could really use some help here.

Regards,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:00:19+00:00Added an answer on May 22, 2026 at 5:00 pm

    Is the information schema reliable?

    If it isn’t, neither is your database. (Tip: it isn’t).

    Considering information_schema is a system database and contains info about all databases, any query will take considerably longer. Right?

    That depends on how you query them. Try show indexes to see the available indexes.

    Is there an alternate method to check foreign key constraints? Using SHOW CREATE TABLE and comparing queries does not seem to be a very good idea.

    In theory, show create table queries the information_schema in a slightly different way.

    In practice, and quoting the second link further up, some of the information returned between the two might be inconsistent:

    create table rolando (num int not null, primary key (num) using hash);
    
    mysql> show create table rolando\G
      (...)
      PRIMARY KEY (`num`) USING HASH
    
    mysql> show indexes from rolando;
    (...) | Index_type | (...)
    (...) | BTREE      | (...)
    

    Lastly, see:

    Is querying the MySQL information_schema database a good way to find related tables?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've added a 'version' column to a table that needs to be part of
I have a table with check constraint that is ignored by MySQL. I am
i have a table with two foreign keys as composite key. ActivityTbl - (activityNbr(PK),
I have two table a) tblresign and b) tblemp tblresign has one foreign key
i want something like this the user enter a website link i need check
I need to check the divisibility of a number in c. How can I
I need to check programmatically (in .NET) whether a given user (domain account) is
I need to check the RequestType of an HttpRequest in ASP.NET (or WebRequest.Method ).
I need to check whether a page is being redirected or not without actually
I need to check whether the user executing the script has administrative privileges on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.