- If solution to the problem in title is possible, please guide. I have not found it anywhere.
- If it is possible (to drop auto-increment field without naming it at table, level please guide.
- I can read it from
extrafield ofinformation_schema.columnsand have its name, then it would easy to drop that column from a specific table. But i am seeking for a better solution. - Is there any better/quick solution than my point#3
Question (If it is not already clear 🙂
Is there any query/function to drop all auto-increment columns from database? or at least is there a way to drop an auto-increment column from specific table without knowing the name of that column?
I am thinking this because there can be only 0 or 1 auto-increment column in a table, so mysql might have some built-in extended function to deal with that type of field
There is no such builtin function. Your point #3 is a good option to do this in MySQL. you can also parse
desc mytableoutput.