I have a team that simply adds a column, is it possible to add this column, for example, in front of the "Finish" column.


Perhaps you can somehow read all the columns that are in the database, transfer them to a variable, then delete programmatically in a variable in which all column names fall. Suppose I have a Start Subject1 Perdmet2 Subject3 Finish. I take the names of these columns in a variable. Then delete the finish line there. Somehow I retrieve the last name and in the end we use AFTER.


Or as suggested in comments - Nothing needs to be deleted. You just need to request the name of the field that has the ORDINAL_POSITION value in the desired table of the desired schema one less than the field with the name Finish in the same table of the same schema.

MySqlCommand command = new MySqlCommand("ALTER TABLE Students ADD COLUMN Старт TEXT", sqlConnection); 
  • AFTER is after this - Andrew Reyz
  • one
    What for? Well, really? Just read them in the order you want: select x, y from table or select y, x from table - Andrey NOP
  • There is a complex system) is very necessary. There simply will be created columns each time and you need to create them before the Finish column. Not to create a Finish column every time. Something like this - Andrew Reyz
  • "You only have AFTER or FIRST. No before." So I gave the second link to the reorder. - AK

0