Saturday, September 15, 2012

ENCRPT AND DECRYPT STORED PROCEDURES IN SQLSERVER 2008



To encrypt a stored procedure in sql server 2008 , use with encryption while


creating it.
if stored procedure is already created , then use it with alter statement.

Here is an example to create an encrypted stored procedure:

CREATE PROCEDURE SP_WITH_ENCRYPTION
WITH ENCRYPTION
AS
BEGIN
SELECT 'HI..THIS STORED PROCEDURE IS ENCRYPTED'
END
GO



Any user , even the user with administrative privileges can not view the text

of this procedure now. It is locked.

To decrypt a stored procedure or any other object, we have to use third party

tools.

One of such third party tool is "OPTILLECT" SQL Decryptor tool.

This tool can be downloaded from this url
http://download.cnet.com/Optillect-SQL-Decryptor/3000-10254_4-75300271.html

Using this tool, one can view the text of the encryted stored procedure or

download/save the script of that procedure at some location on to the disc.

This tool simply connects with the sql server and looks like sql server

management studio.

 one has to login with " sa" password (administrator account) to decrypt the

procedures.

No comments:

Post a Comment