In this post, I am sharing script to find last updated AUTO_INCREMENT of a MySQL Table.
Generally, we use LAST_INSERT_ID() function to get last updated AUTO_INCREMENT value for particular running session. This function basically we use with any procedure block and it will return last updated AUTO_INCREMENT value of the last executed statement.
At the other side, Database Administrator also require to find last updated AUTO_INCREMENT value for any table and wants to generate report for that.
Below is a script to find last updated AUTO_INCREMENT value:
WHERE TABLE_SCHEMA = 'Database_Name'
AND TABLE_NAME = 'Table_Name';
Using STATUS command:
SHOW TABLE STATUS FROM Database_Name LIKE 'TableName' ;
Please visit other related Article !
MySQL: Get ID of the Last Updated Row
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.