Encrypting SQL Stored Procedures

 

How to encrypt a SP?

Using WITH ENCRYPTION keyword as below:

 

[cc lang="SQL"]

CREATE PROCEDURE uspPersons WITH ENCRYPTION
AS
SELECT * FROM person.contact
GO

[/cc]

If we try to view using the system stored procedure like sp_helptext it will shout “objects have been encrypted”.

How to decrypt?

Alter the proc without the “WITH ENCRYPTION” key word.

 

[cc lang="SQL"]

CREATE PROCEDURE uspPersons
AS
SELECT * FROM person.contact
GO

[/cc]

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>