16

let's image that one creates an H2 database with table, indexes, etc... Is there an easy way to extract a SQL script to recreate the structure of this database in another H2 database?

I am not referring to the content of the tables, indexes, etc... I am just interested in the general structure of the database to replicate it elsewhere. Thanks.

Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453

1 Answers1

29

I would use SCRIPT NODATA (returns a result set) or SCRIPT NODATA TO 'fileName'.

Samuel Katz
  • 24,066
  • 8
  • 71
  • 57
Thomas Mueller
  • 48,905
  • 14
  • 116
  • 132