zoukankan      html  css  js  c++  java
  • 如何查询数据库外键参考的schema:

    select

       referent.constraint_name as fk_name,

       referent.update_rule,

       referent.delete_rule,

       kcol_usage.table_name as fk_table_name,

       kcol_usage.column_name as fk_column_name,

       kcol_usage1.table_name as pk_table_name,

       kcol_usage1.column_name as pk_column_name

    from

       INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS referent

       join INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcol_usage

          on (referent.constraint_name = kcol_usage.constraint_name) join INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcol_usage1 on (referent.unique_constraint_name = kcol_usage1.constraint_name)

  • 相关阅读:
    alpha冲刺9
    alpha冲刺8
    alpha冲刺7
    alpha冲6
    随堂小测-同学录
    alpha冲刺5
    任务3
    任务2
    任务1
    网站用户行为分析
  • 原文地址:https://www.cnblogs.com/dunnice/p/640092.html
Copyright © 2011-2022 走看看