Topic: Duplicate a table

Hello everyone, is it possible to copy a table to reproduce it exactly, copy/paste it?

Post's attachments

Attachment icon Table.png 9.43 kb, 1 downloads since 2026-04-08 

Destiny

Re: Duplicate a table

You cannot copy-paste a table, why would you want to duplicate a table?

Re: Duplicate a table

Salut Destiny, TCoton,
It is an unusual request - perhaps you could explain in more detail what you are trying to do.
When you hear about someone having two or more tables with identical structures, it is usually because they are trying to differentiate between something (for example, a table ('electricalproducts') for electrical products and a table ('mechanicalproducts') for mechanical products). 
It can be done but the usual approach with a relational database would be to have one table ('products') and then differentiate between the type of products by using a look-up table ('producttypes').
Having just one main table ('products') makes your processing much more straightforward and also future-proofs your application - if you need more product types (eg 'hydraulic'), it's simply a new row in the 'producttypes' table that the user can create) as opposed to creating a whole new table in your data schema and then having to redeploy your application.
Have a look at the attachment.
Derek.

Post's attachments

Attachment icon destiny.jpg 73.13 kb, 2 downloads since 2026-04-08 

4 (edited by sparrow 2026-04-08 20:49:41)

Re: Duplicate a table

Hi Derek, Destiny, Tcoton


Yes, it's possible. However, not in MVD itself.
I'll describe an example of copying a table structure in the same project with a different name.
If you only need the structure without the data:
1. Close the MVD project with your existing table.
2. Open the tables.ini file in Notepad+ (or similar).
3. Copy the desired table, starting with the name in square brackets and the field names and descriptions below it,
    and paste it at the end of the file, separated by a blank line. Change the table name in square brackets..
4. Save the file.
5. Delete the sqlite.db database file.  Warning! Data will be lost!
6. Open your project.
7. Run it. A database file with tables will be automatically created.

If you need to save data, add a data export at the beginning and an import at the end.

Re: Duplicate a table

sparrow wrote:

Hi Derek, Destiny, Tcoton


Yes, it's possible. However, not in MVD itself.
I'll describe an example of copying a table structure in the same project with a different name.
If you only need the structure without the data:
1. Close the MVD project with your existing table.
2. Open the tables.ini file in Notepad+ (or similar).
3. Copy the desired table, starting with the name in square brackets and the field names and descriptions below it,
    and paste it at the end of the file, separated by a blank line. Change the table name in square brackets..
4. Save the file.
5. Delete the sqlite.db database file.  Warning! Data will be lost!
6. Open your project.
7. Run it. A database file with tables will be automatically created.

If you need to save data, add a data export at the beginning and an import at the end.

As I said, not copy-paste. I know about these steps but it is not practical at all.

Re: Duplicate a table

This is a question I was asking myself in case I needed to recreate tables of the same type.
Thank you for clarifying, and the duplication using "Table.ini" is perfect.

Destiny