What is the correct way to distribute a SQLServer database with an application?
-
05-07-2019 - |
Question
Over the years I have seen many approaches to this:
- Packaging a detached database file
- Packaging a backup, which is restored at installation time
- Creating the database from scratch using scripts
In my opinion, the 3rd option, creating a new database from scratch, building the data structure from scripts and populating any static data with a script is the best approach. Its repeatable, and should always work.
This question could also apply to other dbms.
Solution
I would recommend the third option for the exact reason you suggest.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow