title: Stored proceedure to set start value for autoincrement field
body: <p>I am new-bie to MySQL. I want a user-defined function for the below functionality. I have table that has rowid column which has UNIQUE, AUTO-INCREMENT, NOT NULL values. When the table has 100 rows,next id value is set to 101 by default.But when I delete 50 rows, then add a new row, it's again 101 but not 51.How to create &amp; call function that updates value according to current no of rows.Plz give complete function code &amp; how to call it when some rows are deleted in table. </p>