Answer: A procedure can be encrypted using
WITH ENCRYPTION
CREATE PROCEDURE SP_TESTPROC
WITH ENCRYPTION
AS
BEGIN
SELECT * FROM TABLE_NAME
END
Use of encrypting a stored procedure is to secure your procedure code, if you want to deploy your procedure at client server, encrypt it so that no one can read your procedure code, it is just similar as wrapped a procedure in oracle.
It is not advisable to encrypt a stored procedure because there is no way to decrypt your procedure, it is one way call only.
If your requirement to encrypt a procedure then keep your source code copy of procedure at some location for further use.
Asked In: Many Interviews |
Alert Moderator