I have an app which will be deployed on production PCs with SQL Server. I want to be able to store and retrieve a version of the schema in my database. I'm interested in best practices to be able to accomplish this, with the following main goals:
- Able to store and easily retrieve a version number of the database.
- Hidden or more difficult to find and manipulate by clients.
- Able to be edited/changed when we create a new version.
- Backing up the DB or detacting the DB keeps the version # for forensics.
I wish there were a way to store a "version" in the metadata or not a normal table, which could be accessed/set through a system stored procedure.
Any ideas or best practices?
EDIT: One option I found which may be promising is to use SQL Server Extended Properties, to put a key|value assigned to the DB with "Schema_Version" and the version number. It isn't encrypted (but the value could be), and isn't hidden, but at least is removed from the actual DB structure which some of our users and field personnel browse (to my frustration! :) )