schema_auto_increment_columns Sys Schema View
The schema_auto_increment_columns view lists tables with AUTO_INCREMENT columns, showing the current value and the maximum allowed value for the column type.
Description
Column
Description
Example
CREATE OR REPLACE TABLE animals (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO animals (name) VALUES
('dog'),('cat'),('penguin'),
('fox'),('whale'),('ostrich');
SELECT * FROM sys.schema_auto_increment_columns\G
*************************** 1. row ***************************
table_schema: test
table_name: animals
column_name: id
data_type: tinyint
column_type: tinyint(4)
is_signed: 1
is_unsigned: 0
max_value: 127
auto_increment: 7
auto_increment_ratio: 0.0551Last updated
Was this helpful?

