MySql Query To Get Important Column Properties of A Table

10:57 PM
MySql Query :

SELECT  COLUMN_NAME
      , DATA_TYPE
      , CHARACTER_MAXIMUM_LENGTH
      , NUMERIC_PRECISION
      , NUMERIC_SCALE
      , EXTRA
      , COLUMN_KEY
      , COLUMN_DEFAULT
      , IS_NULLABLE
      , COLUMN_COMMENT
FROM    INFORMATION_SCHEMA.COLUMNS
WHERE   table_name = 'YourTableName'
        AND TABLE_SCHEMA = 'YourDatabaseName'


Example OutPut:





0 comments:

Post a Comment