I am working on a project that has versions. If a new version is ready to publish, I prepare stored procedures to update the database by the DBA. I sent him the SPs and he executes them. However, I don’t want the DBA to see my SP codes. Is it possible transport stored procedure without showing the code to the DBA.
Share
One option is to provide the SQL Stored Proc in an Encrypted text file.And write your own app in .NET which will read the Encrypted SQL Text ,decrypt it and then deploy to the Selected Server.
If you work in .NET then you will know how easy it is to write such an app.Just provide that App with your stored Procs.DBA will be able to deploy the stored proc using that App wihout seeing them.
For simple scenarios you can hardcode the ‘Password’ required to decrypt the SQL Text but for more sensitive scenarios you can use PKI.
Like all other solutions, this solution can be reverse engineered but IMHO a better option than re-writing your Stored Proc logic in CLR.
Note:i am assuming you will use
WITH ENCRYPTIONoption to create the Stored Proc.