Hi Friends,
I Want To Encrypt My Stored Prodcedure For Security Purpose
How I Can Encrypt My SP
Plz Help Me...
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 23, 2012, 8:35 AM EST
Please refer the below links
http://www.codeproject.com/Articles/38583/How-Do-I-Protect-My-Stored-Procedure-Code
http://www.codeproject.com/Tips/239100/Encrypting-all-the-Stored-Procedures-of-a-Database
Thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 23, 2012, 5:53 PM EST
When you create SP @ that time use "With Encription" keyword.
CREATE PROCEDURE dbo.test
WITH ENCRYPTION
AS
BEGIN
SELECT* from mydatatable
END
hope this help.
to decript sp please refer.
http://msdynamicstips.com/2008/12/24/decrypt-sql-2005-stored-procedures-functions-views-and-triggers/
Anuja PawarRank #1,404 · 1.2K reputationPosted Jan 24, 2012, 12:34 AM EST
Inorder to encrypt the text of stored procedures containing sensitive information, Sql Server provides WITH ENCRYPTION to encrypt the Stored Procedure.
CREATE procedure [dbo].[SP_GET_Employee_Details_encrypt]
WITH ENCRYPTION AS
SELECT EMP_id,First_name,Last_name,Email_id
from Employee
Order by Email_id
Once the stored procedure has been created WITH ENCRYPTION, attempts to view the stored procedure returns a message specifying that the text is encrypted:
EXEC sp_helptext SP_GET_Employee_Details_encrypt
The text for object 'SP_GET_Employee_Details_encrypt' is encrypted.
One note of caution. Save the original text of the stored procedure before encrypting it, as there is no straightforward way to decode the encrypted text. One hack is to attach a debugger to the server process and retrieve the decrypted procedure from memory at runtime.
Refer this for more information
http://www.mssqltips.com/sqlservertip/1046/decrypting-sql-server-database-objects/
sagar Bhosale162 reputationPosted Jan 25, 2012, 1:26 AM EST
Anuja PawarRank #1,404 · 1.2K reputationPosted Jan 25, 2012, 3:23 AM EST