Secure Scripting: How to transfer SQL code securely
Sometimes it is important to send the procedure to the customer
for the update. Not always safe to send it in clear form. By design of SQL
Server it is not possible to transfer encrypted objects in encrypted form.
However SQL Shield can help here.
Suppose you want to update the procedure MyTest:
|CREATE PROCEDURE MyTest
SQL Shield can create encrypted CREATE statement for the object
and encrypt text inside.
Start SQL Shield, open the database, select objects you want to encrypt and
start encryption dialog. Choose Generate Secure Script:
Choose output file and enter optional password. Password is needed if want to
recover the object in the future.
After you press "Start" SQL Shield will produce output.sql with the
content similar to the picture below. You can open produced OUTPUT.SQL file from
SQL Server Management Studio. Do not open it with any other editors. It could be
that it will corrupt it.
SQL Shield GUI produces output file in Unicode format. It looks like the
procedure disappeared, however it is encrypted. Most chars are not printable.
However if you take larger procedure you would probably see some strange
characters. Free version of SQL Shield can work with short objects up to 300
After you run that statement the procedure will be decoded internally and
created in its original form. After you try to call the procedure you get the
If you specified the password, you can use Decryptor to recover the original