0

How to create and drop a table outside of SQL, that is, I have a table that I need to change fields, include fields and for this I need to drop the old one, create a new one to load it and save the other table as historical. I can either drop or create this table. Would you like to know the best solution to continue with this maintenance in an application? Thank you very much in advance. An XML or other form ... I dont know.

6
  • 1
    If you were to explain what you're actually trying to accomplish, and perhaps the context within which that requirement operates, we may be better able to suggest a solution. Right now you're using SQL terms (create, drop) to describe a circumstance you have explicitly stated will occur without SQL, so it's not particularly clear what you want. Jan 10, 2019 at 21:56
  • There are many SQL-compliant databases, from Oracle to Firebird. Each is different. Jan 10, 2019 at 22:49
  • I have an application with SQL database. One of the tables I do periodic maintenance . It has rates. Now and then I need to create new columns and for this I need to back up this table, drop it and recreate it. The application will be migrated to a new server where it will be prohibited to perform this routine maintenance on it. So, I would like to know how I can solve this by implementing directly in the c # / aspnet application. web.Does have on WEB anything to this issue? Jan 10, 2019 at 23:49
  • Can you try to alter the table and add the column and ensure your SQL login has appropriate permissions to do so. You could run something like ALTER TABLE <table> ADD <column> VARCHAR(20) NULL Jan 10, 2019 at 23:57
  • Can I do it by frontend app?If it is possible, how can i do it? Jan 11, 2019 at 0:12

1 Answer 1

0

I don't think what you are asking is practical - it appears akin to asking how to write a sentence without using characters. SQL is used to setup, manipulate, backup and otherwise handle MySQL databases.

Anything like xml or Jason or another description will, at some level need to be converted to sql to be injected into the database.

The only other solution I can think if - which us a hellishly bad idea - would be to become an expert on the file format representing the tables and manipulate these directly outside of MySQL. Of-course, the chance if causing corruption us extremely high, and you require MORE permissions/access to do this then to be granted appropriate permissions to alter tables in SQL.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .