What I am trying to achieve:
I have a big SQL script, around 20.000 lines, that initializes a new database for our application. This script is automatically generated by pasting together numerous smaller scripts, all the stored procedures and SQL functions files (one per file), etc.
I run this script either from SSMS or with SQLCMD.
Moreover, every time there is an application upgrade, e.g. from dbVersion 748 to dbVersion 749, we generate an upgrade script that can upgrade any dbVersion to 749, plus a new initialization script for a 749 database.
Needless to say all procs/funcs are WITH ENCRYPTION.
Also needless to say, I can't give these scripts to the customer, coz that would beat the purpose of WITH ENCRYPTION.
However I want the customer to be able to initialize/upgrade new databases themselves (following some predefined processes).
Is there any way to make these scripts available to the customer in encrypted form so that they can be executed by the customer with one of the available tools, like SQLCMD?
The only other way I can think of is to provide my own tool, that can read the encrypted files, decrypt them in-memory and execute them directly against the selected database.
Not such a big challenge, but I just wanted to know if there is some other option.