68

I have little problem with DBeaver. I want to export my structure from each table from database in file .txt. I found how to export all data but I don't need this data, just table structure. If you have some solutions for export table structure .csv it'll be good.

Here is a an image about structure of the table:

https://imgur.com/a/oTVMFhw

Iani M.D.
  • 783
  • 1
  • 6
  • 7

4 Answers4

105

If you are happy to have the table structures as SQL CREATE statements, then you can just go to the navigator panel on the left, into "Tables", select all the tables, then right click and Choose "Generate SQL" -> DDL

Cloudranger
  • 1,749
  • 1
  • 12
  • 6
  • When trying to run the script generated I get error in SQL syntax. If I run the create statements one by one however then they all get created. – HomeIsWhereThePcIs Oct 03 '19 at 11:35
  • 9
    This method of generating DDL does not maintain the correct table order. Child tables can come before parent tables and cause errors with foreign key references. – Amit Naidu Oct 05 '20 at 17:52
  • @AmitNaidu, do you have a way to create DDL in correct table and view order? – PURVESH PATEL Mar 21 '23 at 20:00
65

Click on Tables -> Views Tables -> Select All tables in right window Right click selection -> Generate SQL" -> DDL

Thang Luu Quoc
  • 651
  • 5
  • 2
2

I tried like this:

  • Doubleclick the table columns
  • Select all the columns
  • Choose right click the mouse and select copy advanced info
  • Open an Excel -> paste special -> choose text option
  • All your table data structure will be in the Excel sheet
Yuri
  • 4,254
  • 1
  • 29
  • 46
Veera
  • 31
  • 1
  • This is a bad option. Imagine a situation where I have a DB of 15+gb? Probably the data doesnt even fit the RAM to be copy/pasted. You machine would just freeze. – Oxydron Aug 28 '20 at 12:46
  • 2
    The answer is fine, you can copy advanced just the table meta without the actual data – Felix K. Nov 24 '20 at 17:51
  • Yes, this is fine. This also worked for me. All you want, and get is the table column names, datatypes etc. – Ferhat May 24 '22 at 15:16
0

to download the general database to .sql

[dbaver][1] [sql][2]

![1]: https://i.stack.imgur.com/gNRxN.png ![2]: https://i.stack.imgur.com/qDDtD.png and press start

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 21 '23 at 08:15