Describe table structure

前端 未结 13 2201
北恋
北恋 2020-12-23 15:37

Which query will give the table structure with column definitions in SQL?

相关标签:
13条回答
  • 2020-12-23 16:25

    In DBTools for Sybase, it's sp_columns your_table_name.

    0 讨论(0)
  • 2020-12-23 16:27
    SELECT *
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE table_name = 'student'
    
    0 讨论(0)
  • 2020-12-23 16:28

    In MySQL you can use DESCRIBE <table_name>

    0 讨论(0)
  • 2020-12-23 16:28

    Highlight table name in the console and press ALT+F1

    0 讨论(0)
  • 2020-12-23 16:32

    For SQL Server use exec sp_help

    USE db_name;
    exec sp_help 'dbo.table_name'
    

    For MySQL, use describe

    DESCRIBE table_name;
    
    0 讨论(0)
  • 2020-12-23 16:35

    For Sybase aka SQL Anywhere the following command outputs the structure of a table:

    DESCRIBE 'TABLE_NAME';
    
    0 讨论(0)
提交回复
热议问题