views:

318

answers:

2

Hi, I've been creating some applications with SQLExpress and find myself, scripting the database creation, tables and other entities etc. after application installation. Is this the normal way?

Thanks

A: 

A faster way would be to make a backup of a template database, and restore that as part of the install.

AFAIK, thats how MS and Orcl (especially) do it.

StingyJack
+1  A: 

Making a template database and restoring that works only if you do not need to upgrade your database while keeping (most of) the data.

Even though it is cumbersome, I actually use a few classes that check the database versions and run the necessary scripts (either installation of SQLExpress, installing the database or doing upgrades).

Bernie